Parser { public FileInput parse(String code) { AstNode astNode = astParser.parse(code); return new PythonTreeMaker().fileInput(astNode); }  FileInput parse(String code);  }
@Test public void test() { Parser parser = new Parser(); FileInput result = parser.parse(""); assertThat(result.statements()).isNull(); result = parser.parse("foo()"); assertThat(result.statements().statements()).hasSize(1); }
@Test(expected = RecognitionException.class) public void parsing_error() { Parser parser = new Parser(); parser.parse("foo("); }