@SuppressWarnings("unchecked")
  private <T> T getTypeKeyValueScanner(StoreScanner storeScanner, Class<T> keyValueScannerClass) {
    List<T> resultScanners = new ArrayList<T>();
    for (KeyValueScanner keyValueScanner : storeScanner.currentScanners) {
      if (keyValueScannerClass.isInstance(keyValueScanner)) {
        resultScanners.add((T) keyValueScanner);
      }
    }
    assertTrue(resultScanners.size() == 1);
    return resultScanners.get(0);
  }
Wait flush thread stopping before {@link DefaultMemStore#doClearSnapshot}
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java