private static <T> boolean areEqualDocumentContentProperties(@NotNull List<? extends DiffContent> contents,
                                                               @NotNull Function<? super DocumentContent, ? extends T> propertyGetter) {
    List<T> properties = ContainerUtil.mapNotNull(contents, (content) -> {
      if (content instanceof EmptyContent) return null;
      if (content instanceof FileDocumentContentImpl o && o.getProject() != null) {
        try (AccessToken ignore = ProjectLocator.withPreferredProject(o.getFile(), o.getProject())) {
          return propertyGetter.apply(o);
        }
      }
      return propertyGetter.fun((DocumentContent)content);
    });

    if (properties.size() < 2) return true;
    return new HashSet<>(properties).size() == 1;
  }
private static <T> boolean areEqualDocumentContentProperties(@NotNull List<? extends DiffContent> contents,
                                                               @NotNull Function<? super DocumentContent, ? extends T> propertyGetter)