@Override
    public Iterator<Vertex> vertices(final Direction direction, final String... edgeLabels) {
        if (TinkerHelper.inComputerMode(this.graph))
            return direction.equals(Direction.BOTH) ?
                    IteratorUtils.concat(
                            IteratorUtils.map(this.edges(Direction.OUT, edgeLabels), Edge::inVertex),
                            IteratorUtils.map(this.edges(Direction.IN, edgeLabels), Edge::outVertex)) :
                    IteratorUtils.map(this.edges(direction, edgeLabels), edge -> edge.vertices(direction.opposite()).next());

        return isTxMode
                ? (Iterator) TinkerHelper.getVerticesTx(this, direction, edgeLabels)
                : (Iterator) TinkerHelper.getVertices(this, direction, edgeLabels);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java