for (Group group : userGroups) {
List<User> groupUsers = identityService.createUserQuery().memberOfGroup(group.getId()).list();
for (User user: groupUsers) {
if (!user.getId().equals(userId)) {
allGroupUsers.add(new UserDto(user.getId(), user.getFirstName(), user.getLastName()));
}
}
allGroups.add(new GroupDto(group.getId(), group.getName()));
}