AggregateParser { private static void invalidExpr(String expr) { throw new BadRequestException("Invalid aggregates expr '" + expr + "'"); }  static Aggregate parse(String expr, Boolean allowSingleExpr); static Aggregate parse(String expr);  }
@Test public void testInvalidExpr() { assertInvalidExpr("a"); assertInvalidExpr("sum()"); assertInvalidExpr("sum( )"); assertInvalidExpr("sum(a) a b"); assertInvalidExpr("sum(a),a"); assertInvalidExpr("sum0(a)"); }