code: public Optional<Self> mergeWith(Self latter) {
          if(latter.position == this.position + this.insertedLength()) {
              S removedText = concat(this.removed, latter.removed);
              S addedText = concat(this.inserted, latter.inserted);
              return Optional.of(create(this.position, removedText, addedText));
          } else if(latter.position + latter.removedLength() == this.position + this.insertedLength()) {
              if(this.position <= latter.position) {
                  S addedText = concat(sub(this.inserted, 0, latter.position - this.position), latter.inserted);
                  return Optional.of(create(this.position, this.removed, addedText));
              }
              else {
                  S removedText = concat(sub(latter.removed, 0, this.position - latter.position), this.removed);
                  return Optional.of(create(latter.position, removedText, latter.inserted));
              }
          } else {
              return Optional.empty();
          }
      }
docs: Merges this change with the given change, if possible.
  This change is considered to be the former and the given
  change is considered to be the latter.
  Changes can be merged if either
  <ul>
  <li>the latter's start matches the former's added text end; or</li>
  <li>the latter's removed text end matches the former's added text end.</li>
  </ul>
  @param latter change to merge with this change.
  @return a new merged change if changes can be merged,
  {@code null} otherwise.