SecurityManagementUtils { public static Set<Role> getRegisteredRoles() { return RoleRegistry.get().getRegisteredRoles(); }  static User createUser(final String id); static User createUser(final String id,
                                  final Set<Group> groups); static User createUser(final String id,
                                  final Set<Group> groups,
                                  final Set<Role> roles); static User createUser(final String id,
                                  final Set<Group> groups,
                                  final Set<Role> roles,
                                  final Map<String, String> properties); static Group createGroup(final String name); static Role createRole(final String name); static User clone(final User user); static Set<Group> getGroups(final UserSystemManager userSystemManager,
                                       final String username); static Set<Role> getRoles(final UserSystemManager userSystemManager,
                                     final String username); static Set<Role> getRegisteredRoles(); static Set<String> getRegisteredRoleNames(); static void populateGroupOrRoles(final String name,
                                            final Set<String> registeredRoles,
                                            final Set<Group> groups,
                                            final Set<Role> roles); static Set<String> rolesToString(final Set<Role> roles); static Set<String> groupsToString(final Set<Group> groups); static final Capability[] USERS_CAPABILITIES; static final Capability[] GROUPS_CAPABILITIES; static final Capability[] ROLES_CAPABILITIES; }
@Test public void testGetRegisteredRoles() { RoleRegistry.get().registerRole("role1"); RoleRegistry.get().registerRole("role2"); final Set<Role> roles = SecurityManagementUtils.getRegisteredRoles(); assertNotNull(roles); assertTrue(roles.size() == 2); assertFalse(roles.contains(new RoleImpl("admin"))); }