@Override
    public Principal nominate(final List<Principal> principals, final Map<String, List<Object>> attributes) throws Throwable {
        val principalIds = principals.stream()
            .filter(Objects::nonNull)
            .map(p -> p.getId().trim().toLowerCase(Locale.ENGLISH))
            .collect(Collectors.toCollection(LinkedHashSet::new));
        val count = principalIds.size();
        if (count > 1) {
            LOGGER.debug("Principal resolvers produced [{}] distinct principals [{}]", count, principalIds);
        }
        return electPrincipal(principals, attributes);
    }
This is {@link DefaultPrincipalElectionStrategy} that selects the primary principal
to be the first principal in the chain of authentication history.

@author Misagh Moayyed
@since 4.2.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/principal/DefaultPrincipalElectionStrategy.java