GroupPrincipals { @NotNull public static Enumeration<? extends Principal> members(@NotNull Principal principal) { if (principal instanceof GroupPrincipal) { return ((GroupPrincipal) principal).members(); } return Collections.emptyEnumeration(); } private  GroupPrincipals(); static boolean isGroup(@NotNull Principal principal); @NotNull static Enumeration<? extends Principal> members(@NotNull Principal principal); static boolean isMember(@NotNull Principal principal, @NotNull Principal member);  }
@Test public void testMembersOfNonGroup() { assertEquals(Collections.emptyEnumeration(), GroupPrincipals.members(mock(Principal.class))); }
@Test public void testMembersOfGroupPrincipal() { GroupPrincipal gp = mock(GroupPrincipal.class); GroupPrincipals.members(gp); verify(gp, times(1)).members(); }