static bool replaceTreeNodeChildren_withDummyChild2(final DefaultMutableTreeNode node, fL children, fO dummyChild, final F1> makeChildren) { if (node == null) false; ret swing(func -> bool { L oldChildren = mapMethod getUserObject(node.children()); if (eq(oldChildren, children)) false; node.removeAllChildren(); for (A c : unnull(children)) { DefaultMutableTreeNode node2 = new(c); if (!empty(callF(makeChildren, c))) node2.add(new DefaultMutableTreeNode(dummyChild)); node.add(node2); } true; }); }