### Question:
ElementFactory { public Edge getEdge(UUID id) { if (id == null) return null; return edgeCache.getIfPresent(id); } private  ElementFactory(ActGraph owner); Set<Edge> createEdges(ObjectFactBindingEntity inBinding); Edge getEdge(UUID id); Vertex getVertex(UUID id); static Builder builder();  }### Answer:
@Test public void testGetEdgeWithNullId() { assertNull(elementFactory.getEdge(null)); }
@Test public void testGetEdgeNotCached() { assertNull(elementFactory.getEdge(UUID.randomUUID())); }
@Test public void testGetEdgeCached() { ObjectFactBindingEntity inBinding = createInBinding(Direction.BiDirectional); FactEntity.FactObjectBinding outBinding = createOutBinding(Direction.BiDirectional); Edge first = mockAndRunCreateEdges(inBinding, outBinding); Edge second = elementFactory.getEdge((UUID) first.id()); assertSame(first, second); }