@Test
    public void shouldApplyStrategiesRecursivelyWithGraph() {
        final Graph graph = TinkerGraph.open();
        final GraphTraversalSource g = traversal().withEmbedded(graph).withStrategies(new TraversalStrategy.ProviderOptimizationStrategy() {
            @Override
            public void apply(final Traversal.Admin<?, ?> traversal) {
                final Graph graph = traversal.getGraph().get();
                graph.addVertex("person");
            }
        });

        // adds one person by way of the strategy
        g.inject(0).iterate();
        assertEquals(1, traversal().withEmbedded(graph).V().hasLabel("person").count().next().intValue());

        // adds two persons by way of the strategy one for the parent and one for the child
        g.inject(0).sideEffect(__.addV()).iterate();
        assertEquals(3, traversal().withEmbedded(graph).V().hasLabel("person").count().next().intValue());
    }
Validating that mid-traversal hasId() also unwraps ids in lists in addition to ids in arrays as per TINKERPOP-2863
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java