protected Vertex resolveVertex(final Traverser.Admin<S> traverser, final Traversal.Admin<S, Object> traversal) {
        final Object o = TraversalUtil.apply(traverser, traversal);
        if (o instanceof Vertex)
            return (Vertex) o;
        else if (o instanceof Map) {
            final Map search = (Map) o;
            final Vertex v = IteratorUtils.findFirst(searchVertices(search)).get();
            return tryAttachVertex(v);
        }
        throw new IllegalArgumentException(
                String.format("Vertex does not exist for mergeE: %s", o));
    }
Translate the Map into search criteria. Default implementation is to translate the Map into a g.E() or
g.V().out/inE() traversal. Graph providers will presumably optimize this traversal to use whatever indices are
present and appropriate for efficiency.

Callers are responsible for closing this iterator when finished.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java