private void sampleUntilFileExists(final File file)
      throws InterruptedException, TimeoutException {
    long minutes = 1;
    long timeout = System.nanoTime() + MINUTES.toNanos(minutes);
    int count = 0;
    do {
      sample(advanceNanosTimeStamp());
      count++;
      Thread.sleep(10); // avoid hot thread loop
    } while (!fileExisted(file) && System.nanoTime() < timeout);
    if (!fileExisted(file)) {
      throw new TimeoutException("File " + file + " does not exist after " + count
          + " samples within " + minutes + " " + MINUTES);
    }
    System.out.println("Sampled " + count + " times to create " + file);
  }
Validates number of files under this.dir while ignoring this.dirOfDeletedFiles.
geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java