code: public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(
              int from, int to, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> mapper) {
          ensureValidRange(from, to);
          BiIndex start = tree.locate(NAVIGATE, from);
          BiIndex end = tree.locate(NAVIGATE, to);
          return replace(start, end, mapper);
      }
docs: Replaces the given portion {@code "from..to"} in the document by getting that portion of this document,
  passing it into the mapping function, and using the result as the replacement. Returns
  <ol>
  <li>
  the updated version of this document that includes the replacement,
  </li>
  <li>
  the {@link RichTextChange} that represents the change from this document to the returned one, and
  </li>
  <li>
  the modification used to update an area's list of paragraphs.
  </li>
  </ol>