code: public Set<String> getParentUserGroupIdentifiers(LDAPConnection ldapConnection,
              String userDN) throws GuacamoleException {
  
          Collection<String> attributes = confService.getGroupNameAttributes();
          List<LDAPEntry> userGroups = getParentUserGroupEntries(ldapConnection, userDN);
  
          Set<String> identifiers = new HashSet<>(userGroups.size());
          userGroups.forEach(entry -> {
  
              // Determine unique identifier for user group
              String name = queryService.getIdentifier(entry, attributes);
              if (name != null)
                  identifiers.add(name);
  
              // Ignore user groups which lack a name attribute
              else
                  logger.debug("User group \"{}\" is missing a name attribute "
                          + "and will be ignored.", entry.getDN());
  
          });
  
          return identifiers;
  
      }
docs: Returns the identifiers of all user groups that the given user is a
  member of. Only identifiers of user groups which are readable by the
  current user will be retrieved.
  
  @param ldapConnection
  The current connection to the LDAP server, associated with the
  current user.
  
  @param userDN
  The DN of the user whose group membership should be retrieved.
  
  @return
  The identifiers of all readable parent user groups of the user
  having the given DN.
  
  @throws GuacamoleException
  If an error occurs preventing retrieval of user groups.