### Question:
TopologicalOrderIterator extends AbstractGraphIterator<V, E> { @Override public void setCrossComponentTraversal(boolean crossComponentTraversal) { if (!crossComponentTraversal) { throw new IllegalArgumentException("Iterator is always cross-component"); } } 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(expected = IllegalArgumentException.class) public void testTryToDisableCrossComponent() { Graph<Integer, DefaultEdge> graph = new DirectedPseudograph<>(DefaultEdge.class); new TopologicalOrderIterator<>(graph).setCrossComponentTraversal(false); }