void (JTree tree, ActionUrl url) { if (url.myComponent == null) return; final TreePath treePath = CustomizationUtil.getTreePath(tree, url); if (treePath == null) return; DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent(); final int absolutePosition = url.getAbsolutePosition(); if (node.getChildCount() > absolutePosition && absolutePosition >= 0) { DefaultMutableTreeNode child = (DefaultMutableTreeNode)node.getChildAt(absolutePosition); Object userObj = child.getUserObject(); if (url.getComponent().equals(userObj instanceof Pair<?, ?> pair ? pair.first : userObj)) { node.remove(child); } } }