@Test
public void mergeRequest_failed_becomesQueued() {

  DownloadRequest downloadRequest = createDownloadRequest();
  DownloadBuilder downloadBuilder =
      new DownloadBuilder(downloadRequest)
          .setState(Download.STATE_FAILED)
          .setFailureReason(Download.FAILURE_REASON_UNKNOWN);
  Download download = downloadBuilder.build();
  Download mergedDownload =
      DownloadManager.mergeRequest(download, downloadRequest, download.stopReason, NOW_MS);
  Download expectedDownload =
      downloadBuilder
          .setStartTimeMs(NOW_MS)
          .setState(Download.STATE_QUEUED)
          .setFailureReason(Download.FAILURE_REASON_NONE)
          .build();
  assertEqualIgnoringUpdateTime(mergedDownload, expectedDownload);
}