NestedAggGeoHashGrid extends GeoHashGrid { Number selectSmallest(List<Map<String, Object>> buckets) { String smallestKey = pluckBucketName(buckets.get(0)); Number smallestValue = super.pluckMetricValue(buckets.get(0), metricKey, valueKey); for (Map<String,Object> bucket : buckets) { Number value = super.pluckMetricValue(bucket, metricKey, valueKey); if (value.doubleValue() < smallestValue.doubleValue()) { smallestKey = super.pluckBucketName(bucket); smallestValue = value; } } return bucketToRaster(smallestKey, smallestValue); }  @Override void setParams(List<String> params); @Override Number computeCellValue(Map<String,Object> geogridBucket); String getNestedAggKey(); String getMetricKey(); String getValueKey(); String getSelectionStrategy(); String getRasterStrategy(); Map<String, Integer> getTermsMap();  }
@Test public void testSelectSmallest() { Number rasterValue = geohashGrid.selectSmallest(TestUtil.createBuckets(AGG_RESULTS)); assertEquals(1, rasterValue); }