private boolean visitDepthFirst(T vertex, List<T> path) {
        colors.put(vertex, GRAY);
        log.log(FINE, () -> "Vertex start " + vertex + " - colors: " + colors + " - path: " + path);
        for (T adjacent : graph.getAdjacent(vertex)) {
            path.add(adjacent);
            if (colors.get(adjacent) == GRAY) {
                cycle = removePathIntoCycle(path);
                return true;
            }
            if (colors.get(adjacent) == WHITE && visitDepthFirst(adjacent, path)) {
                return true;
            }
            path.remove(adjacent);
        }
        colors.put(vertex, BLACK);
        log.log(FINE, () -> "Vertex end " + vertex + " - colors: " + colors + " - path: " + path);
        return false;
    }
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