@Override
      public void release() {
        if (testStep == TestStep.INIT) {
          this.rowLock.release();
          return;
        }

        if (testStep == TestStep.PUT_STARTED) {
          try {
            testStep = TestStep.PUT_COMPLETED;
            this.rowLock.release();
            // put has been written to the memstore and the row lock has been released, but the
            // MVCC has not been advanced. Prior to fixing HBASE-7051, the following order of
            // operations would cause the non-atomicity to show up:
            // 1) Put releases row lock (where we are now)
            // 2) CheckAndPut grabs row lock and reads the value prior to the put (10)
            // because the MVCC has not advanced
            // 3) Put advances MVCC
            // So, in order to recreate this order, we wait for the checkAndPut to grab the rowLock
            // (see below), and then wait some more to give the checkAndPut time to read the old
            // value.
            latch.await();
            Thread.sleep(1000);
          } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
          }
        } else if (testStep == TestStep.CHECKANDPUT_STARTED) {
          this.rowLock.release();
        }
      }
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