TestUtil.bindParams(pstmt, binds);
QueryPlan plan = pstmt.compileQuery();
assertTrue(plan instanceof AggregatePlan);
Filter filter = plan.getContext().getScan().getFilter();
assertTrue(filter == null || filter instanceof BooleanExpressionFilter);
BooleanExpressionFilter boolFilter = (BooleanExpressionFilter)filter;
AggregatePlan aggPlan = (AggregatePlan)plan;
return new Expressions(boolFilter == null ? null : boolFilter.getExpression(), aggPlan.getHaving());
}