private @Nullable Node getSelectedNode() {
    ThreadingAssertions.assertEventDispatchThread();
    TreePath path = myTree.getLeadSelectionPath();
    Object node = path == null ? null : path.getLastPathComponent();
    return node instanceof Node ? (Node)node : null;
  }
private @Nullable Node getSelectedNode()