@Nullable
    public TextDiffType getDiffType(@NotNull DiffChange change) {
      if (change.getRecord().getBefore() == null) return TextDiffType.INSERTED;
      if (change.getRecord().getAfter() == null) return TextDiffType.DELETED;
      if (change.getFragments() != null && !change.getFragments().isEmpty()) return TextDiffType.MODIFIED;
      return null; // unchanged
    }
@Nullable
    public TextDiffType getDiffType(@NotNull DiffChange change)