### Question:
SourceFile { public String getFragmentByLines(int startLine, int endLine) { Preconditions.checkArgument(startLine <= endLine); return Joiner.on("\n").join(getLines(startLine, endLine)) + "\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 getFragmentByLines() { assertThat(sourceFile.getFragmentByLines(2, 2)) .isEqualTo(" assertThat(sourceFile.getFragmentByLines(8, 8)).isEqualTo(" assertThat(sourceFile.getFragmentByLines(2, 3)) .isEqualTo( " + " assertThat(sourceFile.getFragmentByLines(1, 8)).isEqualTo(SOURCE_TEXT); }