static bool replaceTreeNodeChildren(final DefaultMutableTreeNode node, fL children) { if (node == null) false; ret swing(func -> bool { L oldChildren = mapMethod('getUserObject, node.children()); if (eq(oldChildren, children)) false; node.removeAllChildren(); for (O c : children) node.add(new DefaultMutableTreeNode(c)); true; }); }