public static ConnectedComponents findComponentsRecursive(Graph graph, EdgeTransitionFilter edgeTransitionFilter, boolean excludeSingleEdgeComponents) {
        return new EdgeBasedTarjanSCC(graph, edgeTransitionFilter, excludeSingleEdgeComponents).findComponentsRecursive();
    }
@Test
    public void withTurnRestriction() {
        // here 0-1-2-3 would be a circle and thus belong to same connected component. but if there is a
        // turn restriction for going 0->2->3 this splits the graph into multiple components
        // 0->1
        // |  |
        // 3<-2->4
        g.edge(0, 1).setDistance(1).set(speedEnc, 10, 0); // edge-keys 0,1
        g.edge(1, 2).setDistance(1).set(speedEnc, 10, 0); // edge-keys 2,3
        g.edge(2, 3).setDistance(1).set(speedEnc, 10, 0); // edge-keys 4,5
        g.edge(3, 0).setDistance(1).set(speedEnc, 10, 0); // edge-keys 6,7
        g.edge(2, 4).setDistance(1).set(speedEnc, 10, 0); // edge-keys 8,9

        // first lets check what happens without turn costs
        ConnectedComponents result = EdgeBasedTarjanSCC.findComponentsRecursive(g, fwdAccessFilter, false);
        assertEquals(7, result.getTotalComponents());
        assertEquals(1, result.getComponents().size());
        assertEquals(IntArrayList.from(6, 4, 2, 0), result.getBiggestComponent());
        assertEquals(6, result.getSingleEdgeComponents().cardinality());
        for (IntCursor c : IntArrayList.from(1, 3, 5, 7, 8, 9)) {
            assertTrue(result.getSingleEdgeComponents().get(c.value));
        }

        // now lets try with a restricted turn
        result = EdgeBasedTarjanSCC.findComponentsRecursive(g,
                (prev, edge) -> fwdAccessFilter.accept(prev, edge) && !(prev == 1 && edge.getBaseNode() == 2 && edge.getEdge() == 2), false);
        // none of the edges are strongly connected anymore!
        assertEquals(10, result.getTotalComponents());
        assertEquals(0, result.getComponents().size());
        assertEquals(IntArrayList.from(), result.getBiggestComponent());
        assertEquals(10, result.getSingleEdgeComponents().cardinality());
        for (IntCursor c : IntArrayList.from(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) {
            assertTrue(result.getSingleEdgeComponents().get(c.value));
        }
    }