@Test public void testComparator() { final TestDoubleColumnSelectorImpl selector = new TestDoubleColumnSelectorImpl(new double[]{0.15d, 0.27d}); DoubleSumAggregator agg = new DoubleSumAggregator(selector); Object first = agg.get(); agg.aggregate(); Comparator comp = new DoubleSumAggregatorFactory("null", "null").getComparator(); Assert.assertEquals(-1, comp.compare(first, agg.get())); Assert.assertEquals(0, comp.compare(first, first)); Assert.assertEquals(0, comp.compare(agg.get(), agg.get())); Assert.assertEquals(1, comp.compare(agg.get(), first)); } }