code: public int getPhotosetCount(String userId) throws FlickrException {
          Map<String, Object> parameters = new HashMap<String, Object>();
          parameters.put("method", METHOD_GET_LIST);
  
          if (userId != null) {
              parameters.put("user_id", userId);
          }
  
          // Request the bare minimum
          parameters.put("per_page", String.valueOf(1));
          parameters.put("page", String.valueOf(1));
  
          Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
          if (response.isError()) {
              throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
          }
          Element photosetsElement = response.getPayload();
  
          return Integer.valueOf(photosetsElement.getAttribute("total"));
      }
docs: Convenience method.
  
  Get the total number of sets belonging to a user
  
  @param userId
  The User id
  @return int The number of photosets
  @throws FlickrException