@Test
    @Ignore
    public void WithinTest() {
        final int count = 500;

        final Graph graph = TinkerGraph.open();
        final GraphTraversalSource g = graph.traversal();
        for (int i = 0; i < count; i++) {
            graph.addVertex(T.label, "person", T.id, i);
        }

        graph.vertices().forEachRemaining(a -> {
            graph.vertices().forEachRemaining(b -> {
                if (a != b && ((int) a.id() < 2 || (int) b.id() < 2)) {
                    a.addEdge("knows", b);
                }
            });
        });

        final long start = System.currentTimeMillis();

        final List result = g.
                V().has(T.id,P.lt(count/2)).aggregate("v1").
                V().where(P.without("v1")).
                toList();

        System.out.println(result.size());
        System.out.printf("Done in %10d %n", System.currentTimeMillis() - start);
    }
@author Stephen Mallette (http://stephen.genoprime.com)
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java