@Test
  public void testMultiVersionLoadValue() throws Exception {
    KeyValue[] kvs1 = genKVs(row, family, value, 1, 100);
    KeyValue[] kvs2 = genKVs(row, family, value, 200, 100);

    KeyValue[] kvs = new KeyValue[kvs1.length + kvs2.length];
    System.arraycopy(kvs1, 0, kvs, 0, kvs1.length);
    System.arraycopy(kvs2, 0, kvs, kvs1.length, kvs2.length);

    Arrays.sort(kvs, CellComparator.getInstance());

    ByteBuffer loadValueBuffer = ByteBuffer.allocate(1024);

    Result r = Result.create(kvs);
    for (int i = 0; i < 100; ++i) {
      final byte[] qf = Bytes.toBytes(i);

      loadValueBuffer.clear();
      r.loadValue(family, qf, loadValueBuffer);
      loadValueBuffer.flip();
      assertEquals(loadValueBuffer, ByteBuffer.wrap(Bytes.add(value, Bytes.toBytes(i))));
      assertEquals(ByteBuffer.wrap(Bytes.add(value, Bytes.toBytes(i))),
        r.getValueAsByteBuffer(family, qf));
    }
  }
Run some tests to ensure Result acts like a proper CellScanner.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResult.java