### Question:
DownloadStrategy { public void validFilenameFromResponse(@Nullable String responseFileName, @NonNull DownloadTask task, @NonNull BreakpointInfo info) throws IOException { if (Util.isEmpty(task.getFilename())) { final String filename = determineFilename(responseFileName, task); if (Util.isEmpty(task.getFilename())) { synchronized (task) { if (Util.isEmpty(task.getFilename())) { task.getFilenameHolder().set(filename); info.getFilenameHolder().set(filename); } } } } }  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 validFilenameFromResponse() throws IOException { final String taskFilename = "task-filename"; when(task.getFilename()).thenReturn(taskFilename); final DownloadStrategy.FilenameHolder filenameHolder = mock( DownloadStrategy.FilenameHolder.class); when(task.getFilenameHolder()).thenReturn(filenameHolder); final String responseFilename = "response-filename"; final BreakpointInfo info = mock(BreakpointInfo.class); final DownloadStrategy.FilenameHolder infoFilenameHolder = mock( DownloadStrategy.FilenameHolder.class); when(info.getFilenameHolder()).thenReturn(infoFilenameHolder); final String determineFilename = "determine-filename"; doReturn(determineFilename).when(strategy).determineFilename(responseFilename, task); strategy.validFilenameFromResponse(responseFilename, task, info); verify(filenameHolder, never()).set(anyString()); when(task.getFilename()).thenReturn(null); strategy.validFilenameFromResponse(responseFilename, task, info); verify(filenameHolder).set(determineFilename); verify(infoFilenameHolder).set(determineFilename); }