@Test
  public void testGetCellScanner() throws IOException {
    List<ExtendedCell> a = new ArrayList<>();
    KeyValue akv = new KeyValue(Bytes.toBytes("a"), -1L);
    a.add(akv);
    // Add a few just to make it less regular.
    a.add(new KeyValue(Bytes.toBytes("aa"), -1L));
    a.add(new KeyValue(Bytes.toBytes("aaa"), -1L));
    List<ExtendedCell> b = new ArrayList<>();
    KeyValue bkv = new KeyValue(Bytes.toBytes("b"), -1L);
    a.add(bkv);
    List<ExtendedCell> c = new ArrayList<>();
    KeyValue ckv = new KeyValue(Bytes.toBytes("c"), -1L);
    c.add(ckv);
    List<List<? extends ExtendedCell>> all = new ArrayList<>();
    all.add(a);
    all.add(b);
    all.add(c);
    CellScanner scanner = ReplicationProtobufUtil.getCellScanner(all, 0);
    testAdvancetHasSameRow(scanner, akv);
    // Skip over aa
    scanner.advance();
    // Skip over aaa
    scanner.advance();
    testAdvancetHasSameRow(scanner, bkv);
    testAdvancetHasSameRow(scanner, ckv);
    assertFalse(scanner.advance());
  }
Little test to check we can basically convert list of a list of KVs into a CellScanner
hbase-server/src/test/java/org/apache/hadoop/hbase/protobuf/TestReplicationProtobuf.java