code: private boolean isDescendant(DependencyInfo ancestor, DependencyInfo descendant){
          for (DependencyInfo child : ancestor.getChildren()){
              if (child.equals(descendant)){
                  return true;
              }
              if (isDescendant(child, descendant)){
                  return true;
              }
          }
          return false;
      }
docs: preventing circular dependencies by making sure the dependency is not a descendant of its own