/*
 * Copyright 2017 requery.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.requery.sql;

import io.requery.query.BaseResult;
import io.requery.util.CloseableIterator;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;

public class CollectionResult<E> extends BaseResult<E> {

    private Collection<E> elements;

    /**
     * Creates an empty result
     */
    CollectionResult() {
        this(Collections.<E>emptySet());
    }

    /**
     * Creates a result with a single element
     */
    CollectionResult(E element) {
        this(Collections.singleton(element));
    }

    /**
     * Creates a result from a collection instance.
     */
    CollectionResult(Collection<E> collection) {
        super(1);
        this.elements = collection;
    }

    @Override
    public CloseableIterator<E> iterator(int skip, int take) {
        final Iterator<E> iterator = elements.iterator();
        return new CloseableIterator<E>() {
            @Override
            public void close() {
            }

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public E next() {
                return iterator.next();
            }
        };
    }
}

@@ -779,16 +779,116 @@
 rator;%0A%0A
+/**%0A * A %7B@link io.requery.query.Result%7D that wraps a collection.%0A *%0A * @param %3CE%3E element type%0A */%0A
 public c
@@ -1017,32 +1017,39 @@
 ult%0A     */%0A    
+public 
 CollectionResult
@@ -1159,32 +1159,39 @@
 ent%0A     */%0A    
+public 
 CollectionResult
@@ -1325,20 +1325,27 @@
      */%0A
-
     
+public 
 Collecti

Change CollectionResult visibility to public