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

        val strategy2 = new DefaultPrincipalElectionStrategy(
            PrincipalElectionStrategyConflictResolver.first());
        strategy2.setOrder(10);

        val strategy = new ChainingPrincipalElectionStrategy(strategy1, strategy2);

        val principal1 = CoreAuthenticationTestUtils.getPrincipal("casuser1");
        val principal2 = CoreAuthenticationTestUtils.getPrincipal("casuser2");
        val attributes = CoreAuthenticationTestUtils.getAttributes();

        val principal = strategy.nominate(List.of(principal1, principal2), attributes);
        assertNotNull(principal);
        assertEquals("casuser1", 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