RelationParser { static final Parser<Projection> projection(Parser<Expression> expr) { return Parsers.sequence(expr, ALIAS.optional(), Projection::new); }  static Parser<Relation> query();  }
@Test public void testProjection() { Parser<Projection> parser = RelationParser.projection(ExpressionParser.NUMBER); TerminalParserTest.assertParser(parser, "1", new Projection(ExpressionParserTest.number(1), null)); TerminalParserTest.assertParser(parser, "1 id", new Projection(ExpressionParserTest.number(1), "id")); TerminalParserTest.assertParser(parser, "1 as id", new Projection(ExpressionParserTest.number(1), "id")); }