### Question:
TopologicalOrderIterator extends AbstractGraphIterator<V, E> { @Override public boolean hasNext() { if (cur != null) { return true; } cur = advance(); if (cur != null && nListeners != 0) { fireVertexTraversed(createVertexTraversalEvent(cur)); } return cur != null; } TopologicalOrderIterator(Graph<V, E> graph); @Deprecated  TopologicalOrderIterator(Graph<V, E> graph, Queue<V> queue);  TopologicalOrderIterator(Graph<V, E> graph, Comparator<V> comparator); @Override boolean isCrossComponentTraversal(); @Override void setCrossComponentTraversal(boolean crossComponentTraversal); @Override boolean hasNext(); @Override V next();  }### Answer:
@Test public void testEmptyGraph() { Graph<String, DefaultEdge> graph = new DefaultDirectedGraph<>(DefaultEdge.class); Iterator<String> iter = new TopologicalOrderIterator<>(graph); assertFalse(iter.hasNext()); }