ExpressionParser { static Parser<Expression> simpleNewExpression(Parser<Expression> arg, Parser<DefBody> body) { return Parsers.sequence( term("new").next(TypeLiteralParser.ELEMENT_TYPE_LITERAL), argumentList(arg), body.optional(), (type, args, defBody) -> new NewExpression(null, type, args, defBody)); }  static Parser<Expression> expression(
      Parser<DefBody> classBody, Parser<Statement> statement); static Parser<Expression> arrayInitializer(Parser<Expression> expr);  }
@Test public void testSimpleNewExpression() { Parser<Expression> parser = ExpressionParser.simpleNewExpression(ExpressionParser.IDENTIFIER, EMPTY_BODY); TerminalParserTest.assertResult(parser, "new Foo(a,b)", NewExpression.class, "new Foo(a, b)"); TerminalParserTest.assertResult(parser, "new Foo(a,b){}", NewExpression.class, "new Foo(a, b) {}"); }