@Test
  public void testWithMixedCFs() throws Exception {
    TableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
      HConstants.FOREVER, KeepDeletedCells.TRUE);
    Region region = hbu.createLocalHRegion(htd, null, null);

    long ts = EnvironmentEdgeManager.currentTime();

    Put p = new Put(T1, ts);
    p.addColumn(c0, c0, T1);
    p.addColumn(c0, c1, T1);
    p.addColumn(c1, c0, T1);
    p.addColumn(c1, c1, T1);
    region.put(p);

    p = new Put(T2, ts + 1);
    p.addColumn(c0, c0, T2);
    p.addColumn(c0, c1, T2);
    p.addColumn(c1, c0, T2);
    p.addColumn(c1, c1, T2);
    region.put(p);

    // family markers are each family
    Delete d = new Delete(T1, ts + 1);
    region.delete(d);

    d = new Delete(T2, ts + 2);
    region.delete(d);

    Scan s = new Scan().withStartRow(T1);
    s.setTimeRange(0, ts + 1);
    InternalScanner scanner = region.getScanner(s);
    List<Cell> kvs = new ArrayList<>();
    scanner.next(kvs);
    assertEquals(4, kvs.size());
    scanner.close();

    s = new Scan().withStartRow(T2);
    s.setTimeRange(0, ts + 2);
    scanner = region.getScanner(s);
    kvs = new ArrayList<>();
    scanner.next(kvs);
    assertEquals(4, kvs.size());
    scanner.close();

    HBaseTestingUtil.closeRegionAndWAL(region);
  }
Verify scenarios with multiple CFs and columns
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java