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

    for (FileIndex filePresent: dirIndex.getFilesPresent()) {
      allPresent.add(prefix + filePresent.getFileName());
    }

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