@Override
public Iterable<Vertex> getVertices(final Direction direction, final String... labels) {
if (direction == Direction.BOTH) {
List<Iterable<Vertex>> list = new ArrayList<Iterable<Vertex>>();
list.add(new VerticesFromEdgesIterable(this, Direction.IN, labels));
list.add(new VerticesFromEdgesIterable(this, Direction.OUT, labels));
return new MultiIterable<Vertex>(list);
} else {
return new VerticesFromEdgesIterable(this, direction, labels);
}
}