Graph extends SparseMultigraph<V, E> implements Iterable<V> { public E getEdge(E e) { return getEdge(e.getId()); }  @Override Iterator<V> iterator(); V getVertex(V v); E getEdge(E e); V getVertex(String id); E getEdge(String id); boolean removeVertices(Collection<V> vertices);  }
@Test public void getEdge() { Graph<Task, Dependency> app = new Graph<Task, Dependency>(); Task task = new Task("x"); Task task2 = new Task("y"); Dependency e = new Dependency("e"); app.addEdge(e, task, task2); Assert.assertEquals(e, app.getEdge(e)); Assert.assertTrue(app.containsVertex(task)); Assert.assertTrue(app.containsVertex(task2)); }
@Test public void getEdgePerId() { Graph<Task, Dependency> app = new Graph<Task, Dependency>(); Task task = new Task("x"); Task task2 = new Task("y"); Dependency e = new Dependency("e"); app.addVertex(task); app.addVertex(task2); app.addEdge(e, task, task2); Assert.assertEquals(e, app.getEdge("e")); }
@Test public void getEdgeUnkownId() { Graph<Task, Dependency> app = new Graph<Task, Dependency>(); Assert.assertNull(app.getEdge("y")); }