private void adjustSelection(JTree tree, @Nullable Object preferredSelection) {
    if (preferredSelection == null) {
      return;
    }
    FilteringTreeStructure.FilteringNode node = getTreeStructure().getVisibleNodeFor(preferredSelection);
    promiseVisitor(node).onSuccess(visitor -> TreeUtil.promiseMakeVisible(tree, visitor).onSuccess(path -> {
      tree.setSelectionPath(path);
      TreeUtil.scrollToVisible(tree, path, false);
    }));
  }
private void adjustSelection(JTree tree, @Nullable Object preferredSelection)