BatchAggregationExpression extends PathSegmentExpression { public EvaluationExpression get(final int index) { return this.partials.get(index); } BatchAggregationExpression();  BatchAggregationExpression(final Aggregation... functions);  BatchAggregationExpression(final List<Aggregation> functions); AggregationExpression add(final Aggregation function); AggregationExpression add(final Aggregation function, final EvaluationExpression preprocessing); EvaluationExpression add(final ExpressionFunction aggregation); EvaluationExpression add(final ExpressionFunction aggregation, final EvaluationExpression preprocessing); @Override void appendAsString(final Appendable appendable); @Override boolean equalsSameClass(final PathSegmentExpression other); EvaluationExpression get(final int index);  }
@Test public void shouldPerformBatch() { final BatchAggregationExpression batch = this.createBatchExpression(); final IJsonNode result = batch.evaluate(createArrayNode(2, 3, 4, 5, 1)); Assert.assertTrue(result instanceof IArrayNode); final IArrayNode<?> resultArray = (IArrayNode<?>) result; final double[] doubleResult = new double[resultArray.size()]; for (int index = 0; index < doubleResult.length; index++) { Assert.assertTrue(resultArray.get(index) instanceof INumericNode); doubleResult[index] = ((INumericNode) resultArray.get(index)).getDoubleValue(); } final double[] expected = { 1 + 2 + 3 + 4 + 5, 5, 5 * 5 }; Assert.assertTrue(Arrays.equals(expected, doubleResult)); }