code: public static <PS, SEG, S> Consumer<List<PlainTextChange>> applyMultiPlainTextChange(
              GenericStyledArea<PS, SEG, S> area) {
          return changeList -> {
              MultiChangeBuilder<PS, SEG, S> builder = area.createMultiChange(changeList.size());
              for (PlainTextChange c : changeList) {
                  builder.replaceTextAbsolutely(c.getPosition(), c.getRemovalEnd(), c.getInserted());
              }
              builder.commit();
          };
      }
docs: Applies a list of {@link PlainTextChange}s to the given area when the {@link UndoManager}'s change stream emits
  an event by {@code area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted()}.