String (@NotNull String original, @NotNull String replacement) { String beginning = original.substring(0, getStartOffset()); String ending = original.substring(getEndOffset()); return beginning + replacement + ending; }