### Question:
SourceFile { public void replaceLines(List<String> lines) { sourceBuilder.replace(0, sourceBuilder.length(), Joiner.on("\n").join(lines) + "\n"); } 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 replaceLines() { sourceFile.replaceLines(Arrays.asList("Line1", "Line2")); assertThat(sourceFile.getSourceText()).isEqualTo("Line1\nLine2\n"); }