@Test
public void getAllAuthorities()
{

    final UserCredentials userCredentials = new UserCredentials();
    userCredentials.setUserAuthorityGroups( new HashSet<>( Arrays.asList( userAuthorityGroup1, userAuthorityGroup1Super ) ) );
    Set<String> authorities1 = userCredentials.getAllAuthorities();
    Assert.assertThat( authorities1, Matchers.containsInAnyOrder( "x1", "x2", "z1", UserAuthorityGroup.AUTHORITY_ALL ) );
    Set<String> authorities2 = userCredentials.getAllAuthorities();
    Assert.assertSame( authorities1, authorities2 );
}