AbstractGraphConverter implements GraphConverter { @Override public Edge toEdge(EdgeEntity edge) { requireNonNull(edge, "vertex is required"); Object id = edge.getId().get(); Iterator<Edge> edges = getGraph().edges(id); if (edges.hasNext()) { return edges.next(); } throw new EntityNotFoundException("Edge does not found in the database with id: " + id); }  @Override Vertex toVertex(T entity); @Override List<Property<?>> getProperties(T entity); @Override T toEntity(Vertex vertex); @Override T toEntity(Class<T> entityClass, Vertex vertex); @Override T toEntity(T entityInstance, Vertex vertex); @Override EdgeEntity toEdgeEntity(Edge edge); @Override Edge toEdge(EdgeEntity edge);  }
@Test public void shouldReturnToEdgeErrorWhenIsNull() { assertThrows(NullPointerException.class, () -> getConverter().toEdge(null)); }