public void convertAndAdd(final UserProfile profile,
            final Map<String, Object> profileAttributes,
            final Map<String, Object> authenticationAttributes) {
        if (profileAttributes != null) {
            profileAttributes.entrySet()
                .forEach(entry -> convertAndAdd(profile, PROFILE_ATTRIBUTE, entry.getKey(), entry.getValue()));
        }
        if (authenticationAttributes != null) {
            authenticationAttributes.entrySet()
                .forEach(entry -> convertAndAdd(profile, AUTHENTICATION_ATTRIBUTE, entry.getKey(), entry.getValue()));
        }
    }
Convert the profile and authentication attributes, if necessary, and add them to the profile.

@param profile The profile.
@param profileAttributes The profile attributes. May be {@code null}.
@param authenticationAttributes The authentication attributes. May be {@code null}.
pac4j-core/src/main/java/org/pac4j/core/profile/definition/ProfileDefinition.java