DeclarationParser { static Parser<Member> initializerDef(Parser<Statement> stmt) { return Parsers.sequence( term("static").succeeds(), StatementParser.blockStatement(stmt), ClassInitializerDef::new); }  static Parser<Program> program(); static Program parse(String source); static Program parse(URL url);  }
@Test public void testInitializerDef() { Parser<Member> parser = DeclarationParser.initializerDef(StatementParser.BREAK); TerminalParserTest.assertResult(parser, "static {}", ClassInitializerDef.class, "static {}"); TerminalParserTest.assertResult(parser, "static {break;}", ClassInitializerDef.class, "static {break;}"); TerminalParserTest.assertResult(parser, " {}", ClassInitializerDef.class, "{}"); TerminalParserTest.assertResult(parser, " {break;}", ClassInitializerDef.class, "{break;}"); }