public static ConnectedComponents findComponentsRecursive(Graph graph, EdgeFilter edgeFilter, boolean excludeSingleNodeComponents) {
        return new TarjanSCC(graph, edgeFilter, excludeSingleNodeComponents).findComponentsRecursive();
    }
@Test
    public void test481() {
        // 0->1->3->4->5->6->7
        //  \ |      \<-----/
        //    2
        graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(2, 0).setDistance(1).set(speedEnc, 10, 0);

        graph.edge(1, 3).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(3, 4).setDistance(1).set(speedEnc, 10, 0);

        graph.edge(4, 5).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 0);
        graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 0);

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

        assertEquals(3, scc.getTotalComponents());
        assertEquals(2, components.size());
        assertEquals(IntArrayList.from(2, 1, 0), components.get(1));
        assertEquals(IntArrayList.from(7, 6, 5, 4), components.get(0));

        assertEquals(1, scc.getSingleNodeComponents().cardinality());
        assertTrue(scc.getSingleNodeComponents().get(3));

        assertEquals(8, scc.getNodes());
        assertEquals(components.get(0), scc.getBiggestComponent());

        // exclude single
        scc = TarjanSCC.findComponentsRecursive(graph, edgeFilter, true);
        assertTrue(scc.getSingleNodeComponents().isEmpty());
        assertEquals(3, scc.getTotalComponents());
        assertEquals(2, scc.getComponents().size());
        assertEquals(8, scc.getNodes());
    }