List rdnList = (new LdapName(dn)).getRdns();
// Get leaf RDN
//Rdn rdn = rdnList.get(rdnList.size() - 1);
Rdn rdn = (Rdn) rdnList.get(rdnList.size() - 1);
Attributes nameAttrs = rdn.toAttributes();
// Add attributes of RDN to attrs if not already there
NamingEnumeration enum_ = nameAttrs.getAll();
Attribute nameAttr;
while (enum_.hasMore()) {