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