ElasticsearchResponse implements Iterable<ExprValue> { public boolean isAggregationResponse() { return aggregations != null; } ElasticsearchResponse(SearchResponse esResponse,
                               ElasticsearchExprValueFactory exprValueFactory);  ElasticsearchResponse(SearchHits hits, ElasticsearchExprValueFactory exprValueFactory); boolean isEmpty(); boolean isAggregationResponse(); Iterator<ExprValue> iterator();  }
@Test void response_is_aggregation_when_aggregation_not_empty() { when(esResponse.getAggregations()).thenReturn(aggregations); ElasticsearchResponse response = new ElasticsearchResponse(esResponse, factory); assertTrue(response.isAggregationResponse()); }
@Test void response_isnot_aggregation_when_aggregation_is_empty() { when(esResponse.getAggregations()).thenReturn(null); ElasticsearchResponse response = new ElasticsearchResponse(esResponse, factory); assertFalse(response.isAggregationResponse()); }