code: public static Iterable<BoxGroup.Info> getAllGroups(final BoxAPIConnection api, String ... fields) {
          final QueryStringBuilder builder = new QueryStringBuilder();
          if (fields.length > 0) {
              builder.appendParam("fields", fields);
          }
          return new Iterable<BoxGroup.Info>() {
              public Iterator<BoxGroup.Info> iterator() {
                  URL url = GROUPS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString());
                  return new BoxGroupIterator(api, url);
              }
          };
      }
docs: Gets an iterable of all the groups in the enterprise.
  @param  api the API connection to be used when retrieving the groups.
  @param fields the fields to retrieve.
  @return     an iterable containing info about all the groups.