ExpressionParser { static Parser<BinaryOperator<Expression>> conditional(Parser<Expression> consequence) { return consequence.between(term("?"), term(":")) .map(cons -> (cond, alt) -> new ConditionalExpression(cond, cons, alt)); }  static Parser<Expression> expression(
      Parser<DefBody> classBody, Parser<Statement> statement); static Parser<Expression> arrayInitializer(Parser<Expression> expr);  }
@Test public void testConditional() { TerminalParserTest.assertToString(ConditionalExpression.class, "(1 ? a : 2)", parse(ExpressionParser.conditional(ExpressionParser.IDENTIFIER), "?a:").apply(literal(1), literal(2))); }