NestedAggGeoHashGrid extends GeoHashGrid { Number selectLargest(List<Map<String, Object>> buckets) { String largestKey = pluckBucketName(buckets.get(0)); Number largestValue = super.pluckMetricValue(buckets.get(0), metricKey, valueKey); for (Map<String,Object> bucket : buckets) { Number value = super.pluckMetricValue(bucket, metricKey, valueKey); if (value.doubleValue() > largestValue.doubleValue()) { largestKey = super.pluckBucketName(bucket); largestValue = value; } } return bucketToRaster(largestKey, largestValue); }  @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 testSelectLargest() { Number rasterValue = geohashGrid.selectLargest(TestUtil.createBuckets(AGG_RESULTS)); assertEquals(5, rasterValue); }