HtmlTextConverter { public String convertToHtml() throws IOException { BufferedReader reader = readFileFromSystem(); return convertToHtml(reader); } HtmlTextConverter(String fullFilenameWithPath); String convertToHtml(); String convertToHtml(BufferedReader reader); String getFilename();  }
@Test public void givenAnyInput_thenItIsFollowedByABreakLine() throws IOException { HtmlTextConverter converter = new HtmlTextConverter("not used"); BufferedReader reader = new BufferedReader(new StringReader(" ")); assertEquals(" " + BREAK_LINE, converter.convertToHtml(reader)); }
@Test public void givenAnAmplisand_thenItIsEncoded() throws IOException { HtmlTextConverter converter = new HtmlTextConverter("not used"); BufferedReader reader = new BufferedReader(new StringReader("&")); assertEquals(expect("&amp;"), converter.convertToHtml(reader)); }