BufferedReaderBuilder { public BufferedReaderBuilder appendLine(String string) { return append(string + "\n"); } private  BufferedReaderBuilder(); static BufferedReaderBuilder create(); BufferedReaderBuilder append(String string); BufferedReaderBuilder appendLine(String string); BufferedReader build();  }
@Test void testAppendLine() throws IOException { BufferedReader reader = bufferedReaderBuilder .appendLine(firstTestString) .appendLine(secondTestString) .appendLine(thirdTestString) .build(); Assertions.assertEquals(reader.readLine(), firstTestString); Assertions.assertEquals(reader.readLine(), secondTestString); Assertions.assertEquals(reader.readLine(), thirdTestString); }