ExpressionParser { public static Parser<Expression> arrayInitializer(Parser<Expression> expr) { return expr.sepEndBy(term(",")).between(term("{"), term("}")).map(ArrayInitializer::new); }  static Parser<Expression> expression(
      Parser<DefBody> classBody, Parser<Statement> statement); static Parser<Expression> arrayInitializer(Parser<Expression> expr);  }
@Test public void testArrayInitializer() { Parser<Expression> parser = ExpressionParser.arrayInitializer(ExpressionParser.IDENTIFIER); TerminalParserTest.assertResult(parser, "{}", ArrayInitializer.class, "{}"); TerminalParserTest.assertResult(parser, "{foo,bar}", ArrayInitializer.class, "{foo, bar}"); TerminalParserTest.assertResult(parser, "{foo,bar,}", ArrayInitializer.class, "{foo, bar}"); }