@Override
    protected boolean setInMemoryCompactionFlag() {
      boolean result = super.setInMemoryCompactionFlag();
      int count = setInMemoryCompactionFlagCounter.incrementAndGet();
      if (count <= 1) {
        assertTrue(result);
      }
      if (count == 2) {
        assertTrue(!result);
      }
      return result;
    }
Only the writeAgain thread completes, in memory compact thread would exit,because we
expect that in memory compact executing only once.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java