@Test void testSortSids() { Sid sid1 = new PrincipalSid("b"); Sid sid2 = new PrincipalSid("a"); Sid sid3 = new GrantedAuthoritySid("ROLE_b"); Sid sid4 = new GrantedAuthoritySid("ROLE_a"); LinkedList expected = new LinkedList<>(); expected.addAll(Arrays.asList(sid2, sid4, sid1, sid3)); assertEquals(expected, userRoleTools.sortSids(newHashSet(sid1, sid2, sid3, sid4))); }
List<Sid> sortSids(Set<Sid> sids) { List<Sid> result = new LinkedList<>(sids); result.sort(comparing(UserRoleTools::getName)); return result; }
UserRoleTools { List<Sid> sortSids(Set<Sid> sids) { List<Sid> result = new LinkedList<>(sids); result.sort(comparing(UserRoleTools::getName)); return result; } }
UserRoleTools { List<Sid> sortSids(Set<Sid> sids) { List<Sid> result = new LinkedList<>(sids); result.sort(comparing(UserRoleTools::getName)); return result; } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); }
UserRoleTools { List<Sid> sortSids(Set<Sid> sids) { List<Sid> result = new LinkedList<>(sids); result.sort(comparing(UserRoleTools::getName)); return result; } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); void checkRoleExists(String role); void checkUserExists(String user); List<Sid> getSids(List<String> users, List<String> roles); static Optional<String> getUsername(Sid sid); static Optional<String> getRolename(Sid sid); static String getName(Sid sid); List<Sid> getRolesForSid(Sid sid); }
UserRoleTools { List<Sid> sortSids(Set<Sid> sids) { List<Sid> result = new LinkedList<>(sids); result.sort(comparing(UserRoleTools::getName)); return result; } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); void checkRoleExists(String role); void checkUserExists(String user); List<Sid> getSids(List<String> users, List<String> roles); static Optional<String> getUsername(Sid sid); static Optional<String> getRolename(Sid sid); static String getName(Sid sid); List<Sid> getRolesForSid(Sid sid); static final String ANONYMOUS; }