@Test
  public void testMemStore() throws Exception {
    ColumnFamilyDescriptor cfd = ColumnFamilyDescriptorBuilder.newBuilder(c0).setMinVersions(2)
      .setMaxVersions(1000).setTimeToLive(1).setKeepDeletedCells(KeepDeletedCells.FALSE).build();

    TableDescriptor htd = TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName()))
      .setColumnFamily(cfd).build();
    HRegion region = hbu.createLocalHRegion(htd, null, null);

    // 2s in the past
    long ts = EnvironmentEdgeManager.currentTime() - 2000;

    try {
      // 2nd version
      Put p = new Put(T1, ts - 2);
      p.addColumn(c0, c0, T2);
      region.put(p);

      // 3rd version
      p = new Put(T1, ts - 1);
      p.addColumn(c0, c0, T3);
      region.put(p);

      // 4th version
      p = new Put(T1, ts);
      p.addColumn(c0, c0, T4);
      region.put(p);

      // now flush/compact
      region.flush(true);
      region.compact(true);

      // now put the first version (backdated)
      p = new Put(T1, ts - 3);
      p.addColumn(c0, c0, T1);
      region.put(p);

      // now the latest change is in the memstore,
      // but it is not the latest version

      Result r = region.get(new Get(T1));
      checkResult(r, c0, T4);

      Get g = new Get(T1);
      g.readAllVersions();
      r = region.get(g); // this'll use ScanWildcardColumnTracker
      checkResult(r, c0, T4, T3);

      g = new Get(T1);
      g.readAllVersions();
      g.addColumn(c0, c0);
      r = region.get(g); // this'll use ExplicitColumnTracker
      checkResult(r, c0, T4, T3);

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

      // now the latest version is in the memstore

      g = new Get(T1);
      g.readAllVersions();
      r = region.get(g); // this'll use ScanWildcardColumnTracker
      checkResult(r, c0, T5, T4);

      g = new Get(T1);
      g.readAllVersions();
      g.addColumn(c0, c0);
      r = region.get(g); // this'll use ExplicitColumnTracker
      checkResult(r, c0, T5, T4);
    } finally {
      HBaseTestingUtil.closeRegionAndWAL(region);
    }
  }
Make sure the memstor behaves correctly with minimum versions
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java