@Test
public void selectRange() throws Exception {

  TableAdapter table = new InMemoryTable();
  List<CKeyValue> values = new ArrayList<CKeyValue>();
  values.add(new CKeyValue(new byte[] { 1 }));
  values.add(new CKeyValue(new byte[] { 2 }, new byte[] { 3 },
      new byte[] { 4 }));
  values.add(new CKeyValue(new byte[] { 3 }, new byte[] { 4 },
      new byte[] { 5 }, 0, new byte[] { 6 }));
  table.put(new Put(values));
  ResultFilter range = new ResultFilter(table, new CRange(new byte[] { 1 },
      new byte[] { 3 }));
  assertCount(range.getResultIterator(), 3);
  SeekingCurrentIterator iter = range.getResultIterator();
  iter.seek(new byte[] { 2 });
  int count = 0;
  assertArrayEquals(new byte[] { 2 }, iter.current().getRecordId());
  while (iter.hasNext()) {
    iter.next();
    count++;
  }
  assertEquals(1, count);
  range = new ResultFilter(table, new CRange(new byte[] { 2 }));
  assertCount(range.getResultIterator(), 1);
}