protected Map<String, List<Object>> collectPrincipalAttributes(final Map<String, Object> dbFields) {
        val attributes = new HashMap<String, List<Object>>();
        val principalAttributeMap = CoreAuthenticationUtils.transformPrincipalAttributesListIntoMultiMap(properties.getPrincipalAttributeList());
        principalAttributeMap.forEach((key, names) -> {
            val attribute = dbFields.get(key);
            if (attribute != null) {
                LOGGER.debug("Found attribute [{}] from the query results", key);
                val attributeNames = CollectionUtils.toCollection(names);
                attributeNames.forEach(attrName -> {
                    LOGGER.debug("Principal attribute [{}] is virtually remapped/renamed to [{}]", key, attrName);
                    attributes.put(attrName.toString(), CollectionUtils.wrap(attribute.toString()));
                });
            } else {
                LOGGER.warn("Requested attribute [{}] could not be found in the query results", key);
            }
        });
        return attributes;
    }
Abstract class for database authentication handlers.

@author Scott Battaglia
@since 3.0.0.3
support/cas-server-support-jdbc-authentication/src/main/java/org/apereo/cas/jdbc/AbstractJdbcUsernamePasswordAuthenticationHandler.java