public static @Nullable <T> DataNode<T> findParentRecursively(
    @NotNull DataNode<?> node,
    @NotNull Key<T> key,
    @Nullable Predicate<? super DataNode<T>> predicate
  ) {
    var parent = node.getParent();
    if (parent == null) {
      return null;
    }
    if (key.equals(parent.getKey())) {
      //noinspection unchecked
      var parentNode = (DataNode<T>)parent;
      if (predicate == null || predicate.test(parentNode)) {
        return parentNode;
      }
    }
    return findParentRecursively(parent, key, predicate);
  }
public static @Nullable <T> DataNode<T> findParentRecursively(
    @NotNull DataNode<?> node,
    @NotNull Key<T> key,
    @Nullable Predicate<? super DataNode<T>> predicate
  )