@Override
    public @NotNull TextRange intersection(@NotNull TextRange range) {
      int newStart = Math.max(getStartOffset(), range.getStartOffset());
      int newEnd = Math.min(getEndOffset(), range.getEndOffset());
      assertProperRange(newStart, newEnd, "Invalid range");
      return myTextToRemove != null
             ? new RangeToRemove(newStart, myTextToRemove.subSequence(newStart - getStartOffset(), newEnd - getStartOffset()))
             : new RangeToRemove(newStart, newEnd);
    }
@Override
    public @NotNull TextRange intersection(@NotNull TextRange range)