class KeyCloakGroupManager extends BaseKeyCloakManager implements GroupManager,
                                                                         ContextualManager {

    @Override
    public void assignUsers(String name,
                            Collection<String> users) throws SecurityManagementException {
        checkNotNull("name",
                     name);
        if (users != null) {
            consumeRealm(realmResource -> {
                final UsersResource usersResource = realmResource.users();
                final RolesResource rolesResource = realmResource.roles();
                final RoleResource roleResource = rolesResource.get(name);
                final List<RoleRepresentation> rolesToAdd = new ArrayList<RoleRepresentation>(1);
                rolesToAdd.add(getRoleRepresentation(name,
                                                     roleResource));
                for (String username : users) {
                    final UserResource userResource = getUserResource(usersResource,
                                                                      username);
                    if (userResource == null) {
                        throw new UserNotFoundException(username);
                    }
                    userResource.roles().realmLevel().add(rolesToAdd);
                }
            });
        }
    }

    public  KeyCloakGroupManager();

}