StatementParser { static Parser<Statement> synchronizedBlock(Parser<Statement> stmt) { return term("synchronized").next(blockStatement(stmt)).map(SynchronizedBlockStatement::new); }    }
@Test public void testSynchronizedBlockStatement() { Parser<Statement> parser = StatementParser.synchronizedBlock(SIMPLE_STATEMENT); TerminalParserTest.assertResult(parser, "synchronized {foo;}", SynchronizedBlockStatement.class, "synchronized {foo;}"); }