public static < T > boolean isDescendantOf ( TreeDef . Parented < T > treeDef , T child , T parent ) { T candidateParent = treeDef . parentOf ( child ) ; while ( candidateParent != null ) { if ( candidateParent . equals ( parent ) ) { return true ; } else { candidateParent = treeDef . parentOf ( candidateParent ) ; } } return false ; }
Returns true iff child is a descendant of parent .