private static void assertPath(final Traversal<Vertex, Path> traversal) {
        int path1 = 0;
        int path2 = 0;
        int path3 = 0;
        while (traversal.hasNext()) {
            final Path path = traversal.next();
            if (path.size() == 1) {
                path1++;
            } else if (path.size() == 2) {
                path2++;
            } else if (path.size() == 3) {
                path3++;
            } else {
                fail("Only path lengths of 1, 2, or 3 should be seen");
            }
        }
        assertEquals(6, path1);
        assertEquals(6, path2);
        assertEquals(2, path3);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java