code: public static <N, E> void findSCCs(Graph<N, E> graph, SCCListener<N> listener) {
          TarjanSCCVisitor<N, E> vis = new TarjanSCCVisitor<>(graph, listener);
          for (N node : graph) {
              if (!vis.hasVisited(node)) {
                  GraphTraversal.depthFirst(graph, node, vis);
              }
          }
      }
docs: Find all strongly-connected components in a graph. When a new SCC is found, the {@link
  SCCListener#foundSCC(java.util.Collection)} method is invoked. The listener object may hence not be null.
  <p>
  Tarjan's algorithm is used for realizing the SCC search.
  
  @param graph
  the graph
  @param listener
  the SCC listener
  
  @see TarjanSCCVisitor