private static void deleteDirRecursivelyOnExit(File dir) {
    dir.deleteOnExit();
    for (File f: dir.listFiles()) {
      if (f.isDirectory()) {
        deleteDirRecursivelyOnExit(f);
      } else {
        f.deleteOnExit();
      }
    }
  }
Test util methods to work with local dirs, {@link DirDiff}s and {@link DirIndex}es.
samza-core/src/test/java/org/apache/samza/storage/blobstore/util/BlobStoreTestUtil.java