private int getDepth(Object depender) {
    Set<Object> unvisited = new HashSet<>(vertices.keySet());
    Set<Object> finished = new HashSet<>(vertices.size());

    Object start = depender;
    CycleHolder cycle = new CycleHolder();

    boolean foundCycle = visitCycle(start, unvisited, finished, cycle, 0);

    if (foundCycle) {
      return Integer.MAX_VALUE;
    } else {
      return cycle.getMaxDepth();
    }
  }
return the depth of the subgraph for the given object
geode-core/src/main/java/org/apache/geode/distributed/internal/deadlock/DependencyGraph.java