StatementParser { static Parser<Statement> superCall(Parser<Expression> expr) { return between(phrase("super ("), expr.sepBy(term(",")), phrase(") ;")) .map(SuperCallStatement::new); }    }
@Test public void testSuperCallStatement() { Parser<Statement> parser = StatementParser.superCall(ExpressionParser.IDENTIFIER); TerminalParserTest.assertResult(parser, "super();", SuperCallStatement.class, "super();"); TerminalParserTest.assertResult(parser, "super(foo);", SuperCallStatement.class, "super(foo);"); TerminalParserTest.assertResult(parser, "super(foo,bar);", SuperCallStatement.class, "super(foo, bar);"); }