@Test
    public void shouldAlterTraversalToIncludeIdWhereNecessary() {
        final String repr = traversal.getGremlinLang().getGremlin("__");
        final ElementIdStrategy strategy = ElementIdStrategy.build().create();
        strategy.apply(traversal.asAdmin());

        final Step step = (Step) traversal.asAdmin().getSteps().get(expectedInsertedSteps);
        if (step instanceof AddVertexStep)
            assertThat(repr, ((AddVertexStep) step).getParameters().contains(strategy.getIdPropertyKey()));
        else if (step instanceof AddVertexStartStep)
            assertThat(repr, ((AddVertexStartStep) step).getParameters().contains(strategy.getIdPropertyKey()));
        else if (step instanceof AddEdgeStep)
            assertThat(repr, ((AddEdgeStep) step).getParameters().contains(strategy.getIdPropertyKey()));
        else if (step instanceof PropertiesStep)
            assertEquals(repr, strategy.getIdPropertyKey(), ((PropertiesStep) step).getPropertyKeys()[0]);
        else
            fail("Check test definition - the expectedInsertedSteps should be the index of the step to trigger the ID substitution");
    }
@author Stephen Mallette (http://stephen.genoprime.com)
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategyTraverseTest.java