public static String writeAttribute(Attribute attr) throws ToolLdapException {
   try {
     return LdifUtils.convertToLdif(attr);
   } catch (LdapException e) {
     throw new ToolLdapException(
         String.format(
             "Unable to write LDAP attribute (upId={%s}, values=[%s]) to LDIF string.",
             attr.getUpId(), ToolStringUtils.joinDelimit(attr, ", ")),
         e);
   }
 }