code: public static Iterable<BoxFileVersionRetention.Info> getRetentions(
              final BoxAPIConnection api, QueryFilter filter, String ... fields) {
          filter.addFields(fields);
          return new BoxResourceIterable<BoxFileVersionRetention.Info>(api,
                  ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), filter.toString()),
                  DEFAULT_LIMIT) {
  
              @Override
              protected BoxFileVersionRetention.Info factory(JsonObject jsonObject) {
                  BoxFileVersionRetention retention = new BoxFileVersionRetention(api, jsonObject.get("id").asString());
                  return retention.new Info(jsonObject);
              }
          };
      }
docs: Retrieves all file version retentions matching given filters as an Iterable.
  @param api the API connection to be used by the resource.
  @param filter filters for the query stored in QueryFilter object.
  @param fields the fields to retrieve.
  @return an iterable contains information about all file version retentions matching given filter.