private List<T> removePathIntoCycle(List<T> pathWithCycle) {
        T cycleStart = pathWithCycle.get(pathWithCycle.size() - 1);
        return pathWithCycle.stream()
                .dropWhile(vertex -> ! vertex.equals(cycleStart))
                .toList();
    }
Returns a list of vertices constituting a cycle in the graph, or an empty
list if no cycle was found. Only the first encountered cycle is returned.
container-core/src/main/java/com/yahoo/container/di/componentgraph/cycle/CycleFinder.java