MutableObjectIterator<Record> iterator = new MergeIterator<Record>(iterators, this.serializer, this.comparator);
// check expected order
Record rec1 = new Record();
Record rec2 = new Record();
final Key k1 = new Key();
final Key k2 = new Key();
int pos = 1;
Assert.assertTrue((rec1 = iterator.next(rec1)) != null);
Assert.assertEquals(expected[0], rec1.getField(0, TestData.Key.class).getKey());
while ((rec2 = iterator.next(rec2)) != null) {
k1.setKey(rec1.getField(0, TestData.Key.class).getKey());
k2.setKey(rec2.getField(0, TestData.Key.class).getKey());
Assert.assertTrue(comparator.compare(k1, k2) <= 0);
Assert.assertEquals(expected[pos++], k2.getKey());
Record tmp = rec1;
rec1 = rec2;
rec2 = tmp;
}