// keys that do not aggregate
nkv(tm1, 2, 2, 1, 1, false, "2");
nkv(tm1, 2, 2, 1, 2, false, "3");
AggregatingIterator ai = new AggregatingIterator();
Map<String,String> opts = new HashMap<String,String>();
opts.put("cf001", SummationAggregator.class.getName());
ai.init(new SortedMapIterator(tm1), opts, null);
assertTrue(ai.hasTop());
assertEquals(nk(0, 0, 1, 1), ai.getTopKey());
assertEquals("7", ai.getTopValue().toString());
ai.next();
assertTrue(ai.hasTop());
assertEquals(nk(1, 1, 1, 3), ai.getTopKey());
assertEquals("9", ai.getTopValue().toString());
ai.next();
assertTrue(ai.hasTop());
assertEquals(nk(2, 2, 1, 2), ai.getTopKey());
assertEquals("3", ai.getTopValue().toString());
ai.next();
assertTrue(ai.hasTop());
assertEquals(nk(2, 2, 1, 1), ai.getTopKey());
assertEquals("2", ai.getTopValue().toString());
ai.next();
assertFalse(ai.hasTop());
// seek test
ai.seek(nr(0, 0, 1, 0), EMPTY_COL_FAMS, false);
assertTrue(ai.hasTop());
assertEquals(nk(1, 1, 1, 3), ai.getTopKey());
assertEquals("9", ai.getTopValue().toString());
ai.next();
assertTrue(ai.hasTop());
assertEquals(nk(2, 2, 1, 2), ai.getTopKey());
assertEquals("3", ai.getTopValue().toString());
// seek after key that aggregates
ai.seek(nr(1, 1, 1, 2), EMPTY_COL_FAMS, false);
assertTrue(ai.hasTop());
assertEquals(nk(2, 2, 1, 2), ai.getTopKey());
assertEquals("3", ai.getTopValue().toString());
}