### Question:
ObjectVertex implements Vertex { @Override public Iterator<Edge> edges(Direction direction, String... edgeLabels) { Set<Edge> facts = new HashSet<>(); for (ObjectFactBindingEntity binding : bindings) { if (binding.getDirection() == BiDirectional) { facts.addAll(graph.getElementFactory().createEdges(binding)); } if (binding.getDirection() == FactIsDestination && (direction == Direction.BOTH || direction == Direction.OUT)) { facts.addAll(graph.getElementFactory().createEdges(binding)); } if (binding.getDirection() == FactIsSource && (direction == Direction.BOTH || direction == Direction.IN)) { facts.addAll(graph.getElementFactory().createEdges(binding)); } } return facts .stream() .filter(edge -> SetUtils.set(edgeLabels).isEmpty() || SetUtils.in(edge.label(), edgeLabels)) .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 testEdgesWithDirectionBiDirectional() { UUID objectID = mockObjectWithFact(Direction.BiDirectional); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.edges(BOTH).hasNext()); assertTrue(vertex.edges(IN).hasNext()); assertTrue(vertex.edges(OUT).hasNext()); }
@Test public void testEdgesWithDirectionFactIsDestination() { UUID objectID = mockObjectWithFact(Direction.FactIsDestination); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.edges(BOTH).hasNext()); assertFalse(vertex.edges(IN).hasNext()); assertTrue(vertex.edges(OUT).hasNext()); }
@Test public void testEdgesWithDirectionFactIsSource() { UUID objectID = mockObjectWithFact(Direction.FactIsSource); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.edges(BOTH).hasNext()); assertTrue(vertex.edges(IN).hasNext()); assertFalse(vertex.edges(OUT).hasNext()); }
@Test public void testEdgesFilterByLabel() { UUID objectID = mockObjectWithFact(Direction.BiDirectional); Vertex vertex = new ObjectVertex(getActGraph(), objectID); assertTrue(vertex.edges(BOTH, "type").hasNext()); assertFalse(vertex.edges(BOTH, "something").hasNext()); }