code: public boolean belongsToGroup(String groupName) {
          if (workgroups == null || workgroups.length == 0) {
              return false;
          }
          for (Workgroup g : workgroups) {
              if (g.getName().equals(groupName)) return true;
          }
          return false;
      }
docs: Check whether user belongs to the specified group