code: public boolean belongsTo(String groupname) {
          if (groupname == null) {
              return false;
          }
          for (PMSecurityUserGroup g : getGroups()) {
              if (groupname.equalsIgnoreCase(g.getName())) {
                  return true;
              }
          }
          return false;
      }
docs: Determine if the user belongs to the group