void waitForStableRegionSizeReport(Connection conn, TableName tn) throws Exception {
    // For some stability in the value before proceeding
    // Helps make sure that we got the actual last value, not some inbetween
    AtomicLong lastValue = new AtomicLong(-1);
    AtomicInteger counter = new AtomicInteger(0);
    TEST_UTIL.waitFor(15_000, 500, new Predicate<Exception>() {
      @Override
      public boolean evaluate() throws Exception {
        LOG.debug("Last observed size=" + lastValue.get());
        long actual = getRegionSizeReportForTable(conn, tn);
        if (actual == lastValue.get()) {
          int numMatches = counter.incrementAndGet();
          if (numMatches >= 5) {
            return true;
          }
          // Not yet..
          return false;
        }
        counter.set(0);
        lastValue.set(actual);
        return false;
      }
    });
  }
Test class to exercise the inclusion of snapshots in space quotas
hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithSnapshots.java