PrincipalManagerImpl implements PrincipalQueryManager, PrincipalManager { @Override @NotNull public Principal getEveryone() { Principal everyone = getPrincipal(EveryonePrincipal.NAME); if (everyone == null) { everyone = EveryonePrincipal.getInstance(); } return everyone; } 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 testGetEveryone() { Principal principal = principalMgr.getEveryone(); assertTrue(isGroup(principal)); }
@Test public void testGetEveryone2() { Principal principal = new PrincipalManagerImpl(new TestPrincipalProvider(false)).getEveryone(); assertSame(EveryonePrincipal.getInstance(), principal); }