code: private MaterializedListModification<Paragraph<PS, SEG, S>> trim(MaterializedListModification<Paragraph<PS, SEG, S>> mod) {
          return commonPrefixSuffixLengths(mod.getRemoved(), mod.getAdded()).map((pref, suff) -> {
              if(pref == 0 && suff == 0) {
                  return mod;
              } else {
                  return MaterializedListModification.create(
                          mod.getFrom() + pref,
                          mod.getRemoved().subList(pref, mod.getRemovedSize() - suff),
                          mod.getAdded().subList(pref, mod.getAddedSize() - suff));
              }
          });
      }
docs: Copy of org.reactfx.collection.MaterializedListModification.trim()
  that uses reference comparison instead of equals().