public static <A, B, C extends Traversal<A, B>> C addRepeatToTraversal(final C traversal, final String loopName, final Traversal.Admin<B, B> repeatTraversal) {
        addRepeatToTraversal(traversal, repeatTraversal);
        final Step<?, B> step = traversal.asAdmin().getEndStep();
        ((RepeatStep) step).loopName = loopName;
        return traversal;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatStep.java