class PersistDataStep {

  public List<Task<NodeDataRequest>> persist(
      final List<Task<NodeDataRequest>> tasks,
      final BlockHeader blockHeader,
      final WorldDownloadState downloadState) {
    final Updater updater = worldStateStorage.updater();
    tasks.stream()
        .map(Task::getData)
        .filter(request -> request.getData() != null)
        .forEach(
            request -> {
              if (isRootState(blockHeader, request)) {
                downloadState.setRootNodeData(request.getData());
              } else {
                request.persist(updater);
              }
            });
    updater.commit();
    return tasks;
  }

  public  PersistDataStep(final WorldStateStorage worldStateStorage);

}