private HRegion initHRegion(String callingMethod, Configuration conf) throws IOException {
    int i = 0;
    TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(TABLENAME);
    for (byte[] family : FAMILIES) {
      ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family);
      // even column families are going to have compacted memstore
      if (i % 2 == 0) {
        cfBuilder.setInMemoryCompaction(MemoryCompactionPolicy
          .valueOf(conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY)));
      } else {
        cfBuilder.setInMemoryCompaction(MemoryCompactionPolicy.NONE);
      }
      builder.setColumnFamily(cfBuilder.build());
      i++;
    }

    RegionInfo info = RegionInfoBuilder.newBuilder(TABLENAME).build();
    Path path = new Path(DIR, callingMethod);
    HRegion region = HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build(), false);
    region.regionServicesForStores = Mockito.spy(region.regionServicesForStores);
    ThreadPoolExecutor pool = (ThreadPoolExecutor) Executors.newFixedThreadPool(1);
    Mockito.when(region.regionServicesForStores.getInMemoryCompactionPool()).thenReturn(pool);
    region.initialize(null);
    return region;
  }
This test verifies the correctness of the Per Column Family flushing strategy when part of the
memstores are compacted memstores
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java