public static void getAllAddedInDiff(String basePath, DirDiff dirDiff, Set<String> allAdded) {
    for (File fileAdded: dirDiff.getFilesAdded()) {
      allAdded.add(fileAdded.getAbsolutePath().substring(basePath.length() + 1));
    }

    for (DirDiff dirAdded: dirDiff.getSubDirsAdded()) {
      getAllAddedInDiff(basePath, dirAdded, allAdded);
    }

    for (DirDiff dirRetained: dirDiff.getSubDirsRetained()) {
      getAllAddedInDiff(basePath, dirRetained, allAdded);
    }
  }
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