private static boolean isRolledBackBy(@NotNull ImmutableActionChangeRange lastRange, @NotNull ImmutableActionChangeRange newRange) {
    if (lastRange.isSymmetricTo(newRange)) {
      if (lastRange.getOldLength() == 0) {
        return true;  // `lastRange` inserts some fragment which is then erased by `newRange`
      }
      if (lastRange.hasTheSameOrigin(newRange)) {
        return true;  // `lastRange` and `newRange` refer to the same undoable action
      }
    }
    return false;
  }
private static boolean isRolledBackBy(@NotNull ImmutableActionChangeRange lastRange, @NotNull ImmutableActionChangeRange newRange)