/**
   * Finds the multichunks that need to be downloaded to apply the given file system actions. The
   * method looks at all {@link FileCreatingFileSystemAction}s and returns their multichunks.
   */
  private Set<MultiChunkId> determineRequiredMultiChunks(
      List<FileSystemAction> actions, MemoryDatabase winnersDatabase) {
    Set<MultiChunkId> multiChunksToDownload = new HashSet<MultiChunkId>();

    for (FileSystemAction action : actions) {
      if (action
          instanceof
          FileCreatingFileSystemAction) { // TODO [low] This adds ALL multichunks even though some
                                          // might be available locally
        multiChunksToDownload.addAll(
            determineMultiChunksToDownload(action.getFile2(), winnersDatabase));
      }
    }

    return multiChunksToDownload;
  }