axel/src/main/java/fr/xgouchet/xmleditor/core/model/TreeNode.java
public boolean isAncestor(final @NonNull TreeNode<T> node) {

        TreeNode<T> ancestor = getParent();

        while (ancestor != null) {
            if (ancestor == node) {
                return true;
            }

            ancestor = ancestor.getParent();
        }

        return false;
    }
/**
     * @param node a node to test
     * @return if the given node is an ancestor of this node
     */
@param node a node to test
@return if the given node is an ancestor of this node
@param node a node to test @return if the given node is an ancestor of this node
public boolean isAncestor(final @NonNull TreeNode<T> node) {
        TreeNode<T> ancestor = getParent();
        while (ancestor != null) {
            if (ancestor == node) {
                return true;
            }
            ancestor = ancestor.getParent();
        }
        return false;
    }
public boolean isAncestor ( final @ NonNull TreeNode < T > node ) { TreeNode < T > ancestor = getParent ( ) ; while ( ancestor != null ) { if ( ancestor == node ) { return true ; } ancestor = ancestor . getParent ( ) ; } return false ; }
@param node a node to test
 @return if the given node is an ancestor of this node
@param node a node to test @return if the given node is an ancestor of this node