@Test
  public void testPutAndCheckAndPutInParallel() throws Exception {
    Configuration conf = TEST_UTIL.getConfiguration();
    conf.setClass(HConstants.REGION_IMPL, MockHRegion.class, HeapSize.class);
    TableDescriptorBuilder tableDescriptorBuilder =
      TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName()));
    ColumnFamilyDescriptor columnFamilyDescriptor =
      ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(family)).build();
    tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
    this.region = TEST_UTIL.createLocalHRegion(tableDescriptorBuilder.build(), null, null);
    Put[] puts = new Put[1];
    Put put = new Put(Bytes.toBytes("r1"));
    put.addColumn(Bytes.toBytes(family), Bytes.toBytes("q1"), Bytes.toBytes("10"));
    puts[0] = put;

    region.batchMutate(puts);
    MultithreadedTestUtil.TestContext ctx = new MultithreadedTestUtil.TestContext(conf);
    ctx.addThread(new PutThread(ctx, region));
    ctx.addThread(new CheckAndPutThread(ctx, region));
    ctx.startThreads();
    while (testStep != TestStep.CHECKANDPUT_COMPLETED) {
      Thread.sleep(100);
    }
    ctx.stop();
    Scan s = new Scan();
    RegionScanner scanner = region.getScanner(s);
    List<Cell> results = new ArrayList<>();
    ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(2).build();
    scanner.next(results, scannerContext);
    for (Cell keyValue : results) {
      assertEquals("50", Bytes.toString(CellUtil.cloneValue(keyValue)));
    }
  }
Test written as a verifier for HBASE-7051, CheckAndPut should properly read MVCC. Moved into
TestAtomicOperation from its original location, TestHBase7051
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java