public void replaceTraversal(final Traversal.Admin<A, B> oldTraversal, final Traversal.Admin<A, B> newTraversal) {
        for (int i = 0, j = this.traversals.size(); i < j; i++) {
            if (Objects.equals(oldTraversal, this.traversals.get(i))) {
                this.traversals.set(i, newTraversal);
                break;
            }
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java