package com.tinkerpop.blueprints.util;

import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class StreamFactory {

    public static <T> Stream<T> stream(final Iterable<T> iterable) {
        return StreamFactory.stream(iterable.iterator());
    }

    public static <T> Stream<T> parallelStream(final Iterable<T> iterable) {
        return StreamFactory.parallelStream(iterable.iterator());
    }

    public static <T> Stream<T> stream(final Iterator<T> iterator) {
        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.IMMUTABLE), false);
    }

    public static <T> Stream<T> parallelStream(final Iterator<T> iterator) {
        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.IMMUTABLE), true);
    }

    public static <T> Iterable<T> iterable(final Stream<T> stream) {
        return () -> stream.iterator();
    }
}

@@ -197,16 +197,79 @@
 t;%0A%0A/**%0A
+ * Utility methods for constructing %7B@link Stream%7D objects.%0A *%0A
  * @auth
@@ -352,16 +352,92 @@
 tory %7B%0A%0A
+    /**%0A     * Construct a %7B@link Stream%7D from an %7B@link Iterable%7D.%0A     */%0A
     publ
@@ -554,32 +554,117 @@
 ator());%0A    %7D%0A%0A
+    /**%0A     * Construct a parallel %7B@link Stream%7D from an %7B@link Iterable%7D.%0A     */%0A
     public stati
@@ -789,32 +789,108 @@
 ator());%0A    %7D%0A%0A
+    /**%0A     * Construct a %7B@link Stream%7D from an %7B@link Iterator%7D.%0A     */%0A
     public stati
@@ -1055,32 +1055,117 @@
  false);%0A    %7D%0A%0A
+    /**%0A     * Construct a parallel %7B@link Stream%7D from an %7B@link Iterator%7D.%0A     */%0A
     public stati
@@ -1341,24 +1341,101 @@
 ue);%0A    %7D%0A%0A
+    /**%0A     * Construct an %7B@link Iterable%7D from an %7B@link Stream%7D.%0A     */%0A
     public s

Add javadoc.