### Question:
HtmlParser02 implements HtmlParser { public void parse (Reader input, Writer output) throws Exception { this.input = input; this.output = output; int i; while (-1 != (i = input.read())) { this.c = (char)i; this.cnt++; switch (this.state) { case IN_TAG: this.handleInTag(); break; default: this.handleUnknown(); break; } } }  void parse(Reader input, Writer output); Reader getInput(); void setInput(Reader input); Writer getOutput(); void setOutput(Writer output);  }### Answer:
@Test public final void testParse() throws Exception { final String input = "<html></html>"; reader = new StringReader(input); this.instance.parse(reader, writer); assertEquals("html", writer.getBuffer().toString().trim()); }
@Test public final void testParseFixture() throws Exception { reader = new FileReader(new ClassPathResource("fixture02.in").getFile()); this.instance.parse(reader, writer); String expected = Util.readFileAsString( new FileReader(new ClassPathResource("fixture02.expected").getFile())); assertEquals(expected, writer.toString()); }