static @NotNull String processReplacements(@NotNull CharSequence input,
                                             @NotNull List<? extends Pair<TextRange, String>> replacements) throws IndexOutOfBoundsException {
    StringBuilder result = new StringBuilder();
    int currentOffset = 0;
    for (Pair<TextRange, String> replacement : replacements) {
      result.append(input.subSequence(currentOffset, replacement.getFirst().getStartOffset()));
      result.append(replacement.getSecond());
      currentOffset = replacement.getFirst().getEndOffset();
    }
    result.append(input.subSequence(currentOffset, input.length()));
    return result.toString();
  }
static @NotNull String processReplacements(@NotNull CharSequence input,
                                             @NotNull List<? extends Pair<TextRange, String>> replacements)