protected Map<String, Object> getAttributesFromEntry(final LdapEntry entry) {
        Map<String, Object> attributes = new HashMap<>();
        for (val attribute : entry.getAttributes()) {
            val name = attribute.getName();
            if (attribute.size() > 1) {
                attributes.put(name, attribute.getStringValues());
            } else {
                attributes.put(name, attribute.getStringValue());
            }
        }
        return attributes;
    }
<p>getAttributesFromEntry.</p>

@param entry a {@link LdapEntry} object
@return a {@link Map} object
pac4j-ldap/src/main/java/org/pac4j/ldap/profile/service/LdapProfileService.java