@Test void testGetUser() { assertEquals("test", getUsername(new PrincipalSid("test")).get()); }
public static Optional<String> getUsername(Sid sid) { if (sid instanceof PrincipalSid) { return Optional.of(((PrincipalSid) sid).getPrincipal()); } return Optional.empty(); }
UserRoleTools { public static Optional<String> getUsername(Sid sid) { if (sid instanceof PrincipalSid) { return Optional.of(((PrincipalSid) sid).getPrincipal()); } return Optional.empty(); } }
UserRoleTools { public static Optional<String> getUsername(Sid sid) { if (sid instanceof PrincipalSid) { return Optional.of(((PrincipalSid) sid).getPrincipal()); } return Optional.empty(); } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); }
UserRoleTools { public static Optional<String> getUsername(Sid sid) { if (sid instanceof PrincipalSid) { return Optional.of(((PrincipalSid) sid).getPrincipal()); } return Optional.empty(); } 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 { public static Optional<String> getUsername(Sid sid) { if (sid instanceof PrincipalSid) { return Optional.of(((PrincipalSid) sid).getPrincipal()); } return Optional.empty(); } 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; }