### Question:
ObjectVertex implements Vertex { @Override public Iterator<Vertex> vertices(Direction direction, String... edgeLabels) { return SetUtils.set(edges(direction, edgeLabels), e -> SetUtils.set(e.vertices(direction))) .stream() .reduce(new HashSet<>(), (result, next) -> SetUtils.union(result, next)) .iterator(); } ObjectVertex(ActGraph graph, UUID objectID); @Override Edge addEdge(String label, Vertex inVertex, Object... keyValues); @Override Iterator<Edge> edges(Direction direction, String... edgeLabels); @Override Iterator<Vertex> vertices(Direction direction, String... edgeLabels); @Override Iterator<VertexProperty<V>> properties(String... propertyKeys); @Override VertexProperty<V> property(VertexProperty.Cardinality cardinality, String key, V value, Object... keyValues); @Override Object id(); @Override String label(); @Override Graph graph(); @Override void remove(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); ObjectEntity getObject();  }### Answer:
@Test public void testVerticesWithDirectionBiDirectional() { UUID objectID = mockObjectWithFact(Direction.BiDirectional); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.vertices(BOTH).hasNext()); assertTrue(vertex.vertices(IN).hasNext()); assertTrue(vertex.vertices(OUT).hasNext()); }
@Test public void testVerticesWithDirectionFactIsDestination() { UUID objectID = mockObjectWithFact(Direction.FactIsDestination); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.vertices(BOTH).hasNext()); assertFalse(vertex.vertices(IN).hasNext()); assertTrue(vertex.vertices(OUT).hasNext()); }
@Test public void testVerticesWithDirectionFactIsSource() { UUID objectID = mockObjectWithFact(Direction.FactIsSource); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.vertices(BOTH).hasNext()); assertTrue(vertex.vertices(IN).hasNext()); assertFalse(vertex.vertices(OUT).hasNext()); }
@Test public void testVerticesFilterByLabel() { UUID objectID = mockObjectWithFact(Direction.BiDirectional); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.vertices(BOTH, "type").hasNext()); assertFalse(vertex.vertices(BOTH, "something").hasNext()); }