private void checkNodeValidity(@NotNull DefaultMutableTreeNode node) {
   Enumeration enumeration = node.children();
   while (enumeration.hasMoreElements()) {
     checkNodeValidity((DefaultMutableTreeNode) enumeration.nextElement());
   }
   if (node instanceof Node && node != getModelRoot()) ((Node) node).update(this);
 }