public List<T> findCycle() {
        resetState();
        for (T vertex : graph.getVertices()) {
            if (colors.get(vertex) == WHITE) {
                if (visitDepthFirst(vertex, new ArrayList<>(List.of(vertex)))) {
                    if (cycle == null) throw new IllegalStateException("Null cycle - this should never happen");
                    if (cycle.isEmpty()) throw new IllegalStateException("Empty cycle - this should never happen");
                    log.log(FINE, () -> "Cycle detected: " + cycle);
                    return cycle;
                }
            }
        }
        return new ArrayList<>();
    }
@Test
    void findCycle_is_idempotent_with_cycle() {
        var graph = new Graph<Vertices>();
        graph.edge(A, A);

        var cycleFinder = new CycleFinder<>(graph);
        assertTrue(cycleFinder.findCycle().containsAll(List.of(A, A)));
        assertTrue(cycleFinder.findCycle().containsAll(List.of(A, A)));
    }