### Question:
Parser { public void parse(InputStreamReader in) throws IOException { StringBuffer buffer = new StringBuffer(); try (BufferedReader bin = new BufferedReader(in)) { String line; while ((line = bin.readLine()) != null) { buffer.append(line).append("\n"); } } parse(buffer.toString()); } Parser(ContextVisitor contextVisitor); void parse(InputStreamReader in); void parse(String in);  }### Answer:
@Test public void testParse() throws Exception { StringBuffer buffer = new StringBuffer(); System.out.println(); try (FileReader in = new FileReader(LexerTest.class.getResource("computer.conf").getFile())) { try (BufferedReader bin = new BufferedReader(in)) { String line; while ((line = bin.readLine()) != null) { buffer.append(line).append("\n"); } } } ContextVisitor visitor = new ContextVisitorAdapter() { @Override protected void visitAny(Context ctx) { System.out.println(ctx.toString()); } }; Parser p = new Parser(visitor); p.parse(buffer.toString()); }