// Path: src/main/java/com/asana/models/ResultBodyCollection.java
// public class ResultBodyCollection<T> {
//     public class NextPage {
//         public String offset;
//         public String path;
//         public String uri;
//     }
// 
//     public List<T> data;
// 
//     public String sync;
//     @SerializedName("next_page")
//     public NextPage nextPage;
//     @SerializedName("has_more")
//     public Boolean hasMore;
// }
// 
// Path: src/main/java/com/asana/requests/CollectionRequest.java
// public class CollectionRequest<T> extends Request implements Iterable<T> {
//     /**
//      * @param resource
//      * @param elementClass
//      * @param path
//      * @param method
//      */
//     public CollectionRequest(Resource resource, Class<T> elementClass, String path, String method) {
//         super(resource, elementClass, path, method);
//     }
// 
//     /**
//      * Executes the request, returning the requested list of items
//      *
//      * @return requested items
//      * @throws IOException
//      */
//     public List<T> execute() throws IOException {
//         return this.executeRaw().data;
//     }
// 
//     /**
//      * Executes the request, returning the full response body
//      *
//      * @return Body containing the "data" object and other metadata
//      * @throws IOException
//      */
//     public ResultBodyCollection<T> executeRaw() throws IOException {
//         HttpResponse response = this.client.request(this);
// 
//         if (this.client.logAsanaChangeWarnings) {
//             HttpHeaders reqHeaders = new HttpHeaders();
//             reqHeaders.putAll(this.client.headers);
//             handleAsanaChangeHeader(reqHeaders, response.getHeaders());
//         }
// 
//         return Json.getInstance().fromJson(
//                 new BufferedReader(new InputStreamReader(response.getContent(), StandardCharsets.UTF_8)),
//                 new com.google.common.reflect.TypeToken<ResultBodyCollection<T>>() {
//                 }.where(
//                         new TypeParameter<T>() {
//                         },
//                         this.elementClass
//                 ).getType()
//         );
//     }
// 
//     /**
//      * Returns an iterator that will make one or more paginated requests to the API
//      *
//      * @return Iterator
//      */
//     public Iterator<T> iterator() {
//         return new CollectionPageIterator<T>(this).items();
//     }
// 
//     public CollectionRequest<T> query(Map<String, Object> object) {
//         return (CollectionRequest<T>) super.query(object);
//     }
// 
//     public CollectionRequest<T> query(String key, Object value) {
//         return (CollectionRequest<T>) super.query(key, value);
//     }
// 
//     public CollectionRequest<T> data(HttpContent content) {
//         return (CollectionRequest<T>) super.data(content);
//     }
// 
//     public CollectionRequest<T> data(Map<String, Object> object) {
//         return (CollectionRequest<T>) super.data(object);
//     }
// 
//     public CollectionRequest<T> data(String key, Object value) {
//         return (CollectionRequest<T>) super.data(key, value);
//     }
// 
//     public CollectionRequest<T> option(String key, Object value) {
//         return (CollectionRequest<T>) super.option(key, value);
//     }
// 
//     public CollectionRequest<T> header(String key, String value) {
//         return (CollectionRequest<T>) super.header(key, value);
//     }
// }


import com.asana.models.ResultBodyCollection;
import com.asana.requests.CollectionRequest;
import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
            : longValue;
    }

    /**
     * Retrieve the next page and store the continuation token, the new data, and any IOException that may occur.
     *
     * Note that it is safe to pass null values to {@link CollectionRequest#query(String, Object)}. Method
     * {@link com.asana.Client#request(com.asana.requests.Request)} will not include such options.
     */
    private void retrieveNextPage() {
        if (this.pageSize < Long.MAX_VALUE || this.itemLimit < Long.MAX_VALUE) {
            this.request.query("limit", Math.min(this.pageSize, this.itemLimit - this.count));
        } else {
            this.request.query("limit", null);
        }
        ResultBodyCollection<T> page = null;
        try {
            page = this.getNext();
        } catch (IOException exception) {
            // See comments in hasNext().
            this.ioException = exception;
        }
        if (page != null) {
            this.continuation = this.getContinuation(page);
            if (page.data != null && !page.data.isEmpty()) {
                this.count += page.data.size();
                this.nextData = page.data;
            } else {
                this.nextData = null;
            }
// Path: src/main/java/com/asana/models/ResultBodyCollection.java
// public class ResultBodyCollection<T> {
//     public class NextPage {
//         public String offset;
//         public String path;
//         public String uri;
//     }
// 
//     public List<T> data;
// 
//     public String sync;
//     @SerializedName("next_page")
//     public NextPage nextPage;
//     @SerializedName("has_more")
//     public Boolean hasMore;
// }
// 
// Path: src/main/java/com/asana/requests/CollectionRequest.java
// public class CollectionRequest<T> extends Request implements Iterable<T> {
//     /**
//      * @param resource
//      * @param elementClass
//      * @param path
//      * @param method
//      */
//     public CollectionRequest(Resource resource, Class<T> elementClass, String path, String method) {
//         super(resource, elementClass, path, method);
//     }
// 
//     /**
//      * Executes the request, returning the requested list of items
//      *
//      * @return requested items
//      * @throws IOException
//      */
//     public List<T> execute() throws IOException {
//         return this.executeRaw().data;
//     }
// 
//     /**
//      * Executes the request, returning the full response body
//      *
//      * @return Body containing the "data" object and other metadata
//      * @throws IOException
//      */
//     public ResultBodyCollection<T> executeRaw() throws IOException {
//         HttpResponse response = this.client.request(this);
// 
//         if (this.client.logAsanaChangeWarnings) {
//             HttpHeaders reqHeaders = new HttpHeaders();
//             reqHeaders.putAll(this.client.headers);
//             handleAsanaChangeHeader(reqHeaders, response.getHeaders());
//         }
// 
//         return Json.getInstance().fromJson(
//                 new BufferedReader(new InputStreamReader(response.getContent(), StandardCharsets.UTF_8)),
//                 new com.google.common.reflect.TypeToken<ResultBodyCollection<T>>() {
//                 }.where(
//                         new TypeParameter<T>() {
//                         },
//                         this.elementClass
//                 ).getType()
//         );
//     }
// 
//     /**
//      * Returns an iterator that will make one or more paginated requests to the API
//      *
//      * @return Iterator
//      */
//     public Iterator<T> iterator() {
//         return new CollectionPageIterator<T>(this).items();
//     }
// 
//     public CollectionRequest<T> query(Map<String, Object> object) {
//         return (CollectionRequest<T>) super.query(object);
//     }
// 
//     public CollectionRequest<T> query(String key, Object value) {
//         return (CollectionRequest<T>) super.query(key, value);
//     }
// 
//     public CollectionRequest<T> data(HttpContent content) {
//         return (CollectionRequest<T>) super.data(content);
//     }
// 
//     public CollectionRequest<T> data(Map<String, Object> object) {
//         return (CollectionRequest<T>) super.data(object);
//     }
// 
//     public CollectionRequest<T> data(String key, Object value) {
//         return (CollectionRequest<T>) super.data(key, value);
//     }
// 
//     public CollectionRequest<T> option(String key, Object value) {
//         return (CollectionRequest<T>) super.option(key, value);
//     }
// 
//     public CollectionRequest<T> header(String key, String value) {
//         return (CollectionRequest<T>) super.header(key, value);
//     }
// }


// Path: src/main/java/com/asana/iterator/PageIterator.java
import com.asana.models.ResultBodyCollection;
import com.asana.requests.CollectionRequest;
import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;

            : longValue;
    }

    /**
     * Retrieve the next page and store the continuation token, the new data, and any IOException that may occur.
     *
     * Note that it is safe to pass null values to {@link CollectionRequest#query(String, Object)}. Method
     * {@link com.asana.Client#request(com.asana.requests.Request)} will not include such options.
     */
    private void retrieveNextPage() {
        if (this.pageSize < Long.MAX_VALUE || this.itemLimit < Long.MAX_VALUE) {
            this.request.query("limit", Math.min(this.pageSize, this.itemLimit - this.count));
        } else {
            this.request.query("limit", null);
        }
        ResultBodyCollection<T> page = null;
        try {
            page = this.getNext();
        } catch (IOException exception) {
            // See comments in hasNext().
            this.ioException = exception;
        }
        if (page != null) {
            this.continuation = this.getContinuation(page);
            if (page.data != null && !page.data.isEmpty()) {
                this.count += page.data.size();
                this.nextData = page.data;
            } else {
                this.nextData = null;
            }
        } else {