@Test
public void testGetPrincipalsToCheck() {

    NuxeoPrincipal principal = new UserPrincipal("bob", Arrays.asList(
            "vps", "males"), false, false);
    String[] principals = SecurityService.getPrincipalsToCheck(principal);
    assertEquals(4, principals.length);
    assertTrue(Arrays.asList(principals).contains("bob"));
    assertTrue(Arrays.asList(principals).contains("vps"));
    assertTrue(Arrays.asList(principals).contains("males"));
    assertTrue(Arrays.asList(principals).contains(
            SecurityConstants.EVERYONE));
}