private static void getAllRemovedInRetainedSubDir(String basePath, DirDiff dirDiff, Set<String> allRemoved) {
    String prefix = basePath.isEmpty() ? basePath : basePath + "/";
    for (FileIndex f: dirDiff.getFilesRemoved()) {
      allRemoved.add(prefix + f.getFileName());
    }

    for (DirIndex dirRemoved: dirDiff.getSubDirsRemoved()) {
      getAllRemovedInRemovedSubDir(prefix + dirRemoved.getDirName(), dirRemoved, allRemoved);
    }

    for (DirDiff dirRetained: dirDiff.getSubDirsRetained()) {
      getAllRemovedInRetainedSubDir(prefix + dirRetained.getDirName(), dirRetained, allRemoved);
    }
  }
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