@Test
    public void shouldConvertIteratorToStream() {
        final List<String> iterable = new ArrayList<>();
        iterable.add("test1");
        iterable.add("test2");
        iterable.add("test3");

        assertEquals(3, IteratorUtils.stream(iterable.iterator()).count());
        final Object[] o = IteratorUtils.stream(iterable.iterator()).toArray();
        assertEquals("test1", o[0]);
        assertEquals("test2", o[1]);
        assertEquals("test3", o[2]);
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java