code: public boolean findAndReportCycles(DependencyGraph graph) {
      this.graph = graph;
      cycleDetected = false;
      visitedEdge = new LinkedHashMap<Key<?>, Dependency>(graph.size());
      
      for (Key<?> key : graph.getAllKeys()) {
        visit(key, null);
      }
  
      return cycleDetected;
    }
docs: Detects cycles in the given graph.
  
  @return {@code true} if any cycles were detected