private static DirIndex createDirIndex(String baseDir, DirTreeNode root) {
    String dirName = root.fileName;
    List<FileIndex> filesPresent = new ArrayList<>();
    List<DirIndex> subDirsPresent = new ArrayList<>();

    List<FileIndex> filesRemoved = Collections.emptyList();
    List<DirIndex> subDirsRemoved = Collections.emptyList();

    for (DirTreeNode child: root.children) {
      if (!child.children.isEmpty()) {
        subDirsPresent.add(createDirIndex(baseDir + "/" + child.fileName, child));
      } else {
        filesPresent.add(createFileIndex(baseDir + "/" + child.fileName, child));
      }
    }

    return new DirIndex(dirName, filesPresent, filesRemoved, subDirsPresent, subDirsRemoved);
  }
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