code: public String getIdentifier(LDAPEntry entry, Collection<String> attributes) {
  
          // Retrieve the first value of the highest priority identifier attribute
          for (String identifierAttribute : attributes) {
              LDAPAttribute identifier = entry.getAttribute(identifierAttribute);
              if (identifier != null)
                  return identifier.getStringValue();
          }
  
          // No identifier attribute is present on the entry
          return null;
  
      }
docs: Returns the identifier of the object represented by the given LDAP
  entry. Multiple attributes may be declared as containing the identifier
  of the object when present on an LDAP entry. If multiple such attributes
  are present on the same LDAP entry, the value of the attribute with
  highest priority is used. If multiple copies of the same attribute are
  present on the same LDAPentry, the first value of that attribute is
  used.
  
  @param entry
  The entry representing the Guacamole object whose unique identifier
  should be determined.
  
  @param attributes
  A collection of all attributes which may be used to specify the
  unique identifier of the Guacamole object represented by an LDAP
  entry, in order of decreasing priority.
  
  @return
  The identifier of the object represented by the given LDAP entry, or
  null if no attributes declared as containing the identifier of the
  object are present on the entry.