@Test
    public void shouldConvertPrimitiveArrayToIterator() {
        final int[] array = new int[]{0, 1, 2, 3};

        assertEquals(4, IteratorUtils.count(IteratorUtils.asIterator(array)));

        final Iterator itty = IteratorUtils.asIterator(array);
        for (int i = 0; i < array.length; i++) {
            assertEquals(i, itty.next());
        }
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java