public static void getAllRemovedInIndex(String basePath, DirIndex dirIndex, Set<String> allRemoved) {
    String prefix = basePath.isEmpty() ? basePath : basePath + "/";

    for (FileIndex fileRemoved: dirIndex.getFilesRemoved()) {
      allRemoved.add(prefix + fileRemoved.getFileName());
    }

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

    for (DirIndex dirPresent: dirIndex.getSubDirsPresent()) {
      getAllRemovedInIndex(prefix + dirPresent.getDirName(), dirPresent, 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