@Test
    void verifyOperationWithMultipleAuthn() {
        val strategy1 = new DefaultPrincipalElectionStrategy();
        strategy1.setOrder(100);

        val strategy2 = new DefaultPrincipalElectionStrategy() {
            @Serial
            private static final long serialVersionUID = 332375002782221999L;

            @Override
            protected Principal getPrincipalFromAuthentication(final Collection<Authentication> authentications) {
                return authentications.stream().reduce((first, second) -> second).orElseThrow().getPrincipal();
            }
        };
        strategy2.setOrder(10);

        val strategy = new ChainingPrincipalElectionStrategy(strategy1, strategy2);

        val authentication1 = CoreAuthenticationTestUtils.getAuthentication(CoreAuthenticationTestUtils.getPrincipal("casuser1"));
        val authentication2 = CoreAuthenticationTestUtils.getAuthentication(CoreAuthenticationTestUtils.getPrincipal("casuser2"));
        val attributes = CoreAuthenticationTestUtils.getAttributes();
        val principal = strategy.nominate(List.of(authentication1, authentication2), attributes);
        assertNotNull(principal);
        assertEquals("casuser2", principal.getId());
    }
This is {@link ChainingPrincipalElectionStrategyTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-authentication/src/test/java/org/apereo/cas/authentication/principal/ChainingPrincipalElectionStrategyTests.java