code: private boolean resolveDownloadMediaFormats(MediaArgs mediaArgs) {
      if (!mediaArgs.isDownload()) {
        // not filtering for downloads
        return true;
      }
      List<MediaFormat> candidates = new ArrayList<>();
      if (mediaArgs.getMediaFormats() != null) {
        candidates.addAll(ImmutableList.copyOf(mediaArgs.getMediaFormats()));
      }
      else {
        candidates.addAll(mediaFormatHandler.getMediaFormats());
      }
      MediaFormat[] result = candidates.stream()
          .filter(MediaFormat::isDownload)
          .toArray(size -> new MediaFormat[size]);
      if (result.length > 0) {
        mediaArgs.mediaFormats(result);
        return true;
      }
      else {
        return false;
      }
    }
docs: If a set of media formats is given it is filtered to contain only download media formats.
  If no is given a new set of allowed media formats is created by getting from all media formats those marked as "download".
  If the result is an empty set of media formats (but downloads are requests) resolution is not successful.
  @param mediaArgs Media args
  @return true if resolving was successful