PrincipalManagerImpl implements PrincipalQueryManager, PrincipalManager { @Override @NotNull public PrincipalIterator getGroupMembership(@NotNull Principal principal) { return new PrincipalIteratorAdapter(principalProvider.getMembershipPrincipals(principal)); } PrincipalManagerImpl(@NotNull PrincipalProvider principalProvider); @Override boolean hasPrincipal(@NotNull String principalName); @Override @Nullable Principal getPrincipal(@NotNull String principalName); @Override @NotNull PrincipalIterator findPrincipals(@Nullable String simpleFilter); @Override @NotNull PrincipalIterator findPrincipals(@Nullable String simpleFilter, int searchType); @Override @NotNull PrincipalIterator getPrincipals(int searchType); @Override @NotNull PrincipalIterator getGroupMembership(@NotNull Principal principal); @Override @NotNull Principal getEveryone(); @NotNull @Override PrincipalIterator findPrincipals(@Nullable String simpleFilter, boolean fullText, int searchType, long offset, long limit);  }
@Test public void testGetGroupMembershipEveryoneEmpty() { assertFalse(principalMgr.getGroupMembership(EveryonePrincipal.getInstance()).hasNext()); }
@Test public void testGetGroupMembershipEveryoneWithoutEveryone() { assertFalse(Iterators.contains(principalMgr.getGroupMembership(EveryonePrincipal.getInstance()), EveryonePrincipal.getInstance())); }