ImmutableSet.of(expectedGroup1, expectedGroup2, expectedGroup3);
assertEquals(expectedGroupSet, groupSet);
Set<UserPrincipal> expectedUserSet1 =
ImmutableSet.of(
new UserPrincipal("user1", LOCAL_NAMESPACE),
new UserPrincipal("user2", LOCAL_NAMESPACE));
Collection<Principal> users1 = groups.get(expectedGroup1);
Set<Principal> userSet1 = new HashSet<Principal>(users1);
assertEquals(expectedUserSet1, userSet1);
Set<Principal> expectedUserSet2 = ImmutableSet.of(
new UserPrincipal("user1", LOCAL_NAMESPACE),
new UserPrincipal("user3", LOCAL_NAMESPACE),
new GroupPrincipal("group1", LOCAL_NAMESPACE),
new GroupPrincipal("group3", GLOBAL_NAMESPACE));
Collection<Principal> users2 = groups.get(expectedGroup2);
Set<Principal> userSet2 = new HashSet<Principal>(users2);
assertEquals(expectedUserSet2, userSet2);