code: public Collection<Group> search(String text, int perPage, int page) throws FlickrException {
          GroupList<Group> groupList = new GroupList<Group>();
          Map<String, Object> parameters = new HashMap<String, Object>();
          parameters.put("method", METHOD_SEARCH);
  
          parameters.put("text", text);
  
          if (perPage > 0) {
              parameters.put("per_page", String.valueOf(perPage));
          }
          if (page > 0) {
              parameters.put("page", String.valueOf(page));
          }
  
          Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
          if (response.isError()) {
              throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
          }
          Element groupsElement = response.getPayload();
          NodeList groupNodes = groupsElement.getElementsByTagName("group");
          groupList.setPage(XMLUtilities.getIntAttribute(groupsElement, "page"));
          groupList.setPages(XMLUtilities.getIntAttribute(groupsElement, "pages"));
          groupList.setPerPage(XMLUtilities.getIntAttribute(groupsElement, "perpage"));
          groupList.setTotal(XMLUtilities.getIntAttribute(groupsElement, "total"));
          for (int i = 0; i < groupNodes.getLength(); i++) {
              Element groupElement = (Element) groupNodes.item(i);
              Group group = new Group();
              group.setId(groupElement.getAttribute("nsid"));
              group.setName(groupElement.getAttribute("name"));
              groupList.add(group);
          }
          return groupList;
      }
docs: Search for groups. 18+ groups will only be returned for authenticated calls where the authenticated user is over 18. This method does not require
  authentication.
  
  @param text
  The text to search for.
  @param perPage
  Number of groups to return per page. If this argument is 0, it defaults to 100. The maximum allowed value is 500.
  @param page
  The page of results to return. If this argument is 0, it defaults to 1.
  @return A GroupList Object. Only the fields <em>id</em>, <em>name</em> and <em>eighteenplus</em> in the Groups will be set.
  @throws FlickrException