/** * Create a new iterator * * @param graph the graph */ public AbstractGraphIterator(Graph<V, E> graph) { this.graph = Objects.requireNonNull(graph, "graph must not be null"); this.reusableEdgeEvent = new FlyweightEdgeEvent<>(this, null); this.reusableVertexEvent = new FlyweightVertexEvent<>(this, null); this.crossComponentTraversal = true; this.reuseEvents = false; }