public static < T > T root ( TreeDef . Parented < T > treeDef , T node ) { T lastParent ; T parent = node ; do { lastParent = parent ; parent = treeDef . parentOf ( lastParent ) ; } while ( parent != null ) ; return lastParent ; }
Returns the root of the given tree .