### Question:
DownloadStrategy { protected String determineFilename(@Nullable String responseFileName, @NonNull DownloadTask task) throws IOException { if (Util.isEmpty(responseFileName)) { final String url = task.getUrl(); Matcher m = TMP_FILE_NAME_PATTERN.matcher(url); String filename = null; while (m.find()) { filename = m.group(1); } if (Util.isEmpty(filename)) { filename = Util.md5(url); } if (filename == null) { throw new IOException("Can't find valid filename."); } return filename; } return responseFileName; }  ResumeAvailableResponseCheck resumeAvailableResponseCheck(
            DownloadConnection.Connected connected,
            int blockIndex,
            BreakpointInfo info); int determineBlockCount(@NonNull DownloadTask task, long totalLength); long reuseIdledSameInfoThresholdBytes(); boolean inspectAnotherSameInfo(@NonNull DownloadTask task, @NonNull BreakpointInfo info,
                                          long instanceLength); boolean isUseMultiBlock(final boolean isAcceptRange); void inspectFilenameFromResume(@NonNull String filenameOnStore,
                                          @NonNull DownloadTask task); void validFilenameFromResponse(@Nullable String responseFileName,
                                          @NonNull DownloadTask task,
                                          @NonNull BreakpointInfo info); boolean validFilenameFromStore(@NonNull DownloadTask task); void validInfoOnCompleted(@NonNull DownloadTask task, @NonNull DownloadStore store); @Nullable ResumeFailedCause getPreconditionFailedCause(int responseCode,
                                                                  boolean isAlreadyProceed,
                                                                  @NonNull BreakpointInfo info,
                                                                  @Nullable String responseEtag); boolean isServerCanceled(int responseCode, boolean isAlreadyProceed); void inspectNetworkAvailable(); void inspectNetworkOnWifi(@NonNull DownloadTask task);  }### Answer:
@Test public void determineFilename_tmpFilenameValid() throws IOException { final String validResponseFilename = "file name"; String result = strategy.determineFilename(validResponseFilename, task); assertThat(result).isEqualTo(validResponseFilename); when(task.getUrl()).thenReturn("https: result = strategy.determineFilename(null, task); assertThat(result).isEqualTo("okdownload.3_1.apk"); when(task.getUrl()).thenReturn("https: result = strategy.determineFilename(null, task); assertThat(result).isEqualTo("dreamtobe.cn"); when(task.getUrl()).thenReturn("https: result = strategy.determineFilename(null, task); assertThat(result).isNotEmpty(); when(task.getUrl()) .thenReturn("https: result = strategy.determineFilename(null, task); assertThat(result).isEqualTo("android-studio-ide-171.4408382-mac.dmg"); }