public final @NotNull Promise<TreeVisitor> promiseVisitor(@NotNull Object element) {
    return Promises.asPromise(onValidThread(struct -> {
      return new TreeVisitor.ByTreePath<>(
        TreePathUtil.pathToCustomNode(element, struct::getParentElement),
        node -> node instanceof Node ? ((Node)node).getElement() : null
      );
    }));
  }
public final @NotNull Promise<TreeVisitor> promiseVisitor(@NotNull Object element)