Cycles<EDGE> findCycles() {
        JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph());
        JohnsonCycleFinder.Result rawCycles = johnsonCycleFinder.findCycles();
        return new CyclesInternal<>(mapToCycles(rawCycles), rawCycles.maxNumberOfCyclesReached());
    }
@Test
    public void multiple_cycles_are_detected() {
        Graph<String, Edge<String>> graph = new Graph<>();

        Cycle<Edge<String>> threeElements = randomCycle(3);
        Cycle<Edge<String>> fourElements = randomCycle(4);
        Cycle<Edge<String>> fiveElements = randomCycle(5);

        addCycles(graph, threeElements, fourElements, fiveElements);
        addCrossLink(graph, threeElements, fourElements);
        addCrossLink(graph, fourElements, fiveElements);

        Collection<Cycle<Edge<String>>> cycles = graph.findCycles();

        assertThatCycles(cycles).containsOnly(threeElements, fourElements, fiveElements);
    }