private Iterator<? extends Edge> edges() {
        final AbstractTinkerGraph graph = (AbstractTinkerGraph) this.getTraversal().getGraph().get();
        final HasContainer indexedContainer = getIndexKey(Edge.class);
        Iterator<Edge> iterator;
        final Object[] resolvedIds = this.getIdsAsValues();
        // ids are present, filter on them first
        if (null == resolvedIds)
            iterator = Collections.emptyIterator();
        else if (resolvedIds.length > 0)
            iterator = this.iteratorList(graph.edges(resolvedIds));
        else
            iterator = null == indexedContainer ?
                    this.iteratorList(graph.edges()) :
                    TinkerIndexHelper.queryEdgeIndex(graph, indexedContainer.getKey(), indexedContainer.getPredicate().getValue()).stream()
                                .filter(edge -> HasContainer.testAll(edge, this.hasContainers))
                                .collect(Collectors.<Edge>toList()).iterator();


        iterators.add(iterator);

        return iterator;
    }
List of iterators opened by this step.
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java