### Question:
SourceFile { public void replaceChars(int startPosition, int endPosition, String replacement) { try { sourceBuilder.replace(startPosition, endPosition, replacement); } catch (StringIndexOutOfBoundsException e) { throw new IndexOutOfBoundsException( String.format( "Replacement cannot be made. Source file %s has length %d, requested start " + "position %d, requested end position %d, replacement %s", path, sourceBuilder.length(), startPosition, endPosition, replacement)); } } SourceFile(String path, CharSequence source); static SourceFile create(JavaFileObject fileObject); String getPath(); List<String> getLines(); String getSourceText(); CharSequence getAsSequence(); void setSourceText(CharSequence source); String getFragmentByChars(int startPosition, int endPosition); String getFragmentByLines(int startLine, int endLine); void replaceLines(List<String> lines); void replaceLines(int startLine, int endLine, List<String> replacementLines); void replaceChars(int startPosition, int endPosition, String replacement);  }### Answer:
@Test public void replaceChars() { sourceFile.replaceChars(3, 8, "Sasquatch"); assertThat(sourceFile.getSourceText()).isEqualTo(SOURCE_TEXT.replace("Lorem", "Sasquatch")); assertThat(sourceFile.getLines().get(0)) .isEqualTo(" }