MedianAggregatorStrategy extends AbstractAggregatorStrategy { @Override public Number[] getValues(Record record, int rasterIndex) { final float median = getMedian((Number[]) record.getAttributeValues()[rasterIndex]); return new Number[]{ median, getAggregatedNumber(record, rasterIndex).nT }; }  @Override Number[] getValues(Record record, int rasterIndex); @Override String[] getSuffixes();  }
@Test public void testGetValues() throws Exception { final Float[] valuesForBand1 = { 1F, 2F, 3F, 4F, 5F, 6F }; final Number[][] numbers = new Number[1][]; numbers[0] = valuesForBand1; final DefaultRecord record = new DefaultRecord(numbers); assertEquals(2, strategy.getValues(record, 0).length); assertEquals(3.5F, strategy.getValues(record, 0)[0].doubleValue(), 0.0001); assertEquals(6, strategy.getValues(record, 0)[1].intValue()); }