KeyCloakGroupManager extends BaseKeyCloakManager implements GroupManager,
                                                                         ContextualManager { @Override public Group create(Group entity) throws SecurityManagementException { checkNotNull("entity", entity); consumeRealm(realmResource -> { final RolesResource rolesResource = realmResource.roles(); final RoleRepresentation roleRepresentation = new RoleRepresentation(entity.getName(), entity.getName(), Boolean.FALSE); roleRepresentation.setId(entity.getName()); roleRepresentation.setComposite(false); final ClientResponse response = (ClientResponse) rolesResource.create(roleRepresentation); handleResponse(response); }); return entity; } KeyCloakGroupManager(); @Override void initialize(UserSystemManager userSystemManager); @Override SearchResponse<Group> search(SearchRequest request); @Override Group get(String identifier); @Override List<Group> getAll(); @Override Group create(Group entity); @Override Group update(Group entity); @Override void delete(String... identifiers); @Override GroupManagerSettings getSettings(); @Override void assignUsers(String name,
                            Collection<String> users); @Override void destroy();  }
@Test public void testCreateGroup() { String groupName = "newgroup"; Group newgroup = groupsManager.create(SecurityManagementUtils.createGroup("newgroup")); assertGroup(newgroup, groupName); }