public boolean dependsOn ( DependencyNode dependency ) { boolean dependsDirectly = dependenciesVia . contains ( dependency ) ; if ( dependsDirectly ) return true ; for ( DependencyNode reqDependency : dependency . dependantsVia ) { if ( dependsOn ( reqDependency ) ) return true ; } return false ; }
Directly or indirectly