@ApiStatus.Internal
  public static @NotNull Promise<?> promiseExpand(@NotNull JTree tree, int depth, @NotNull Predicate<@NotNull TreePath> predicate) {
    AsyncPromise<?> promise = new AsyncPromise<>();
    promiseMakeVisible(tree, new TreeVisitor() {
      @Override
      public @NotNull TreeVisitor.VisitThread visitThread() {
        return Registry.is("ide.tree.background.expand", true) ? VisitThread.BGT : VisitThread.EDT;
      }

      @Override
      public @NotNull Action visit(@NotNull TreePath path) {
        return depth < path.getPathCount()
               ? TreeVisitor.Action.SKIP_SIBLINGS
               : predicate.test(path)
               ? TreeVisitor.Action.CONTINUE
               : TreeVisitor.Action.SKIP_CHILDREN;
      }
    }, promise)
      .onError(promise::setError)
      .onSuccess(path -> {
        if (promise.isCancelled()) return;
        promise.setResult(null);
      });
    return promise;
  }
@ApiStatus.Internal
  public static @NotNull Promise<?> promiseExpand(@NotNull JTree tree, int depth, @NotNull Predicate<@NotNull TreePath> predicate)