@Test
    public void shouldAppendOneReferenceElementStep() {
        final Traversal<Vertex, ?> t = g.V().union(out(), in()).groupCount();
        t.asAdmin().applyStrategies();
        assertThat((t.asAdmin().getEndStep() instanceof ReferenceElementStrategy.ReferenceElementStep), is(true));
        assertEquals(1, TraversalHelper.getStepsOfAssignableClass(ReferenceElementStrategy.ReferenceElementStep.class, t.asAdmin()).size());
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ReferenceElementStrategyTest.java