public static ConnectedComponents findComponents(Graph graph, EdgeFilter edgeFilter, boolean excludeSingleNodeComponents) {
        return new TarjanSCC(graph, edgeFilter, excludeSingleNodeComponents).findComponents();
    }
@Test
    public void testFindComponents() {
        // big network (has two components actually, because 9->12 is a one-way)
        //    ---
        //  /     \
        // 4 < 1 - 2
        // |   |
        // <-- 8 - 11 - 12 < 9 - 15
        graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(1, 4).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(1, 8).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(2, 4).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(8, 4).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(8, 11).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(12, 11).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(9, 12).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(9, 15).setDistance(1).set(speedEnc, 10, 10);

        // large network
        // 5 --------
        // |        |
        // 3 - 0 - 13
        //   \ |
        //     7
        graph.edge(0, 13).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(0, 3).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(0, 7).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(3, 7).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(3, 5).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(13, 5).setDistance(1).set(speedEnc, 10, 10);

        // small network
        // 6 - 14 - 10
        graph.edge(6, 14).setDistance(1).set(speedEnc, 10, 10);
        graph.edge(10, 14).setDistance(1).set(speedEnc, 10, 10);

        TarjanSCC.ConnectedComponents scc = TarjanSCC.findComponentsRecursive(graph, edgeFilter, false);
        List<IntArrayList> components = scc.getComponents();

        assertEquals(4, components.size());
        assertEquals(IntArrayList.from(13, 5, 3, 7, 0), components.get(0));
        assertEquals(IntArrayList.from(2, 4, 12, 11, 8, 1), components.get(1));
        assertEquals(IntArrayList.from(10, 14, 6), components.get(2));
        assertEquals(IntArrayList.from(15, 9), components.get(3));

        assertEquals(16, scc.getNodes());
        assertEquals(0, scc.getSingleNodeComponents().cardinality());
        assertEquals(components.get(1), scc.getBiggestComponent());
    }