private static DirTreeNode createDirTree(String baseDir, String[] paths) {
    DirTreeNode root = new DirTreeNode();
    root.fileName = DirIndex.ROOT_DIR_NAME;

    for (String path: paths) {
      DirTreeNode pathRoot = root;
      path = path.trim();
      String[] pathParts = path.split("/");
      for (String pathPart: pathParts) {
        DirTreeNode childNode;

        Optional<DirTreeNode> childNodeOptional = pathRoot.children.stream()
            .filter(dtn -> dtn.fileName.equals(pathPart)).findFirst();

        if (childNodeOptional.isPresent()) {
          childNode = childNodeOptional.get();
        } else {
          childNode = new DirTreeNode();
          childNode.fileName = pathPart;
          pathRoot.children.add(childNode);
        }
        pathRoot = childNode;
      }
    }

    return root;
  }
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