List<SortedKeyValueIterator<Key,Value>> skvil = new ArrayList<SortedKeyValueIterator<Key,Value>>(1);
skvil.add(new SortedMapIterator(tm1));
KeyExtent extent = new KeyExtent(new Text("tablename"), nr(1), nr(0));
MultiIterator mi = new MultiIterator(skvil, extent);
Range r1 = new Range((Text) null, (Text) null);
mi.seek(r1, EMPTY_COL_FAMS, false);
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("5"));
mi.next();
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("6"));
mi.next();
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("7"));
mi.next();
assertFalse(mi.hasTop());
Range r2 = new Range(nk(0, 0), true, nk(1, 1), true);
mi.seek(r2, EMPTY_COL_FAMS, false);
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("5"));
mi.next();
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("6"));
mi.next();
assertFalse(mi.hasTop());
Range r3 = new Range(nk(0, 0), false, nk(1, 1), false);
mi.seek(r3, EMPTY_COL_FAMS, false);
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("5"));
mi.next();
assertFalse(mi.hasTop());
Range r4 = new Range(nk(1, 2), true, nk(1, 1), false);
mi.seek(r4, EMPTY_COL_FAMS, false);
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("5"));
mi.next();
assertFalse(mi.hasTop());
Range r5 = new Range(nk(1, 2), false, nk(1, 1), true);
mi.seek(r5, EMPTY_COL_FAMS, false);
assertTrue(mi.hasTop());
assertTrue(mi.getTopValue().toString().equals("6"));
mi.next();
assertFalse(mi.hasTop());
Range r6 = new Range(nk(2, 1), true, nk(2, 0), true);
mi.seek(r6, EMPTY_COL_FAMS, false);
assertFalse(mi.hasTop());
Range r7 = new Range(nk(0, 3), true, nk(0, 1), true);
mi.seek(r7, EMPTY_COL_FAMS, false);
assertFalse(mi.hasTop());
}