private boolean isDescendant ( DependencyInfo parentDependency , DependencyInfo childDependency ) { for ( DependencyInfo dependencyInfo : childDependency . getChildren ( ) ) { if ( dependencyInfo . equals ( parentDependency ) ) return true ; return isDescendant ( dependencyInfo , childDependency ) ; } return false ; }
avoiding circular - dependencies