private Iterator<? extends Vertex> vertices() {
        final AbstractTinkerGraph graph = (AbstractTinkerGraph) this.getTraversal().getGraph().get();
        final HasContainer indexedContainer = getIndexKey(Vertex.class);
        Iterator<? extends Vertex> 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.vertices(resolvedIds));
        else
            iterator = (null == indexedContainer ?
                    this.iteratorList(graph.vertices()) :
                    IteratorUtils.filter(TinkerIndexHelper.queryVertexIndex(graph, indexedContainer.getKey(), indexedContainer.getPredicate().getValue()).iterator(),
                                         vertex -> HasContainer.testAll(vertex, this.hasContainers)));

        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