@Contract(pure = true)
  public static @Nullable Path findAncestor(@NotNull Path path1, @NotNull Path path2) {
    Path ancestor = path1;
    while (ancestor != null && !path2.startsWith(ancestor)) {
      ancestor = ancestor.getParent();
    }
    return ancestor;
  }
@Contract(pure = true)
  public static @Nullable Path findAncestor(@NotNull Path path1, @NotNull Path path2)