code: @RequestMapping(value = "/{userId}/userGroups", method = RequestMethod.GET)
      public ResponseEntity<Set<UserGroup>> findGroupsOfUser(@PathVariable Integer userId) {
  
          try {
              Set<UserGroup> userGroupsSet = this.service.getGroupsOfUser(userId);
              return new ResponseEntity<Set<UserGroup>>(userGroupsSet, HttpStatus.OK);
          } catch (Exception e) {
              LOG.error("Error finding user with id " + userId + ": "
                  + e.getMessage());
              return new ResponseEntity<Set<UserGroup>>(HttpStatus.NOT_FOUND);
          }
      }
docs: Get the groups of a specific user.
  
  @param userId
  @return