ExpressionParser { static Parser<UnaryOperator<Expression>> qualifiedMethodCall(Parser<Expression> arg) { return Parsers.sequence( term(".").next(TypeLiteralParser.optionalTypeArgs(TypeLiteralParser.TYPE_LITERAL)), Terminals.Identifier.PARSER, argumentList(arg), (t, m, a) -> q -> new MethodCallExpression(q, t, m, a)); }  static Parser<Expression> expression(
      Parser<DefBody> classBody, Parser<Statement> statement); static Parser<Expression> arrayInitializer(Parser<Expression> expr);  }
@Test public void testQualifiedMethodCall() { Parser<UnaryOperator<Expression>> parser = ExpressionParser.qualifiedMethodCall(ExpressionParser.IDENTIFIER); TerminalParserTest.assertToString(MethodCallExpression.class, "1.f(a, b)", parse(parser, ".f(a,b)").apply(literal(1))); TerminalParserTest.assertToString(MethodCallExpression.class, "1.f()", parse(parser, ".f()").apply(literal(1))); }