void () { Object root = myTreeModel.getRoot(); if (root instanceof XValueContainerNode<?>) { // avoid SOE StreamEx.<XValueContainerNode<?>>ofTree((XValueContainerNode<?>)root, n -> StreamEx.of(n.getLoadedChildren())) .forEach(XValueContainerNode::setObsolete); } }