ExpressionParser { static Parser<UnaryOperator<Expression>> qualifiedNew(Parser<Expression> arg, Parser<DefBody> body) { return Parsers.sequence( phrase(". new").next(TypeLiteralParser.ELEMENT_TYPE_LITERAL), argumentList(arg), body.optional(), (t, a, b) -> q -> new NewExpression(q, t, a, b)); }  static Parser<Expression> expression(
      Parser<DefBody> classBody, Parser<Statement> statement); static Parser<Expression> arrayInitializer(Parser<Expression> expr);  }
@Test public void testQualifiedNew() { Parser<UnaryOperator<Expression>> parser = ExpressionParser.qualifiedNew(ExpressionParser.IDENTIFIER, EMPTY_BODY); TerminalParserTest.assertToString(NewExpression.class, "1.new int(a, b) {}", parse(parser, ".new int(a,b){}").apply(literal(1))); TerminalParserTest.assertToString(NewExpression.class, "1.new int(a)", parse(parser, ".new int(a)").apply(literal(1))); }