CompositePrincipalProvider implements PrincipalProvider { @NotNull @Override public Set<Principal> getPrincipals(@NotNull String userID) { Set<Principal> principals = new HashSet<>(); for (PrincipalProvider provider : providers) { principals.addAll(provider.getPrincipals(userID)); } return principals; } CompositePrincipalProvider(List<PrincipalProvider> providers); static PrincipalProvider of(@NotNull List<PrincipalProvider> providers); @Nullable @Override Principal getPrincipal(@NotNull String principalName); @Nullable @Override ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath); @NotNull @Override Set<Principal> getMembershipPrincipals(@NotNull Principal principal); @NotNull @Override Set<Principal> getPrincipals(@NotNull String userID); @NotNull @Override Iterator<Principal> findPrincipals(@Nullable String nameHint, int searchType); @NotNull @Override Iterator<? extends Principal> findPrincipals(int searchType); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable String nameHint, boolean fullText, int searchType,
            long offset, long limit);  }
@Test public void testGetPrincipalsByUnknownId() { assertTrue(cpp.getPrincipals(TestPrincipalProvider.getIDFromPrincipal(TestPrincipalProvider.UNKNOWN)).isEmpty()); }