private void throwExceptionIfNodeDoesntBelongToTree(Object node) {
        boolean result = false;

        if (node instanceof GenericTreeNode) {
            GenericTreeNode<? extends PropertyChangeSupporter> ttn = (GenericTreeNode<? extends PropertyChangeSupporter>) node;

            while (!result && ttn != null) {
                result = ttn == root;

                ttn = ttn.getParent();
            }
        }

        if(!result){
            throw new SwingObjectRunException(ErrorSeverity.SEVERE, "Node does not belong to the tree!", this);
        }

    }