### Question:
ProcessFileStrategy { public boolean isPreAllocateLength(@NonNull DownloadTask task) { boolean supportSeek = OkDownload.with().outputStreamFactory().supportSeek(); if (!supportSeek) return false; if (task.getSetPreAllocateLength() != null) return task.getSetPreAllocateLength(); return true; }  @NonNull MultiPointOutputStream createProcessStream(@NonNull DownloadTask task,
                                                               @NonNull BreakpointInfo info,
                                                               @NonNull DownloadStore store); void completeProcessStream(@NonNull MultiPointOutputStream processOutputStream,
                                      @NonNull DownloadTask task); void discardProcess(@NonNull DownloadTask task); @NonNull FileLock getFileLock(); boolean isPreAllocateLength(@NonNull DownloadTask task);  }### Answer:
@Test public void isPreAllocateLength() throws IOException { mockOkDownload(); when(task.getSetPreAllocateLength()).thenReturn(null); final DownloadOutputStream.Factory factory = OkDownload.with().outputStreamFactory(); when(factory.supportSeek()).thenReturn(false); assertThat(strategy.isPreAllocateLength(task)).isFalse(); when(factory.supportSeek()).thenReturn(true); assertThat(strategy.isPreAllocateLength(task)).isTrue(); when(task.getSetPreAllocateLength()).thenReturn(false); assertThat(strategy.isPreAllocateLength(task)).isFalse(); when(task.getSetPreAllocateLength()).thenReturn(true); assertThat(strategy.isPreAllocateLength(task)).isTrue(); when(factory.supportSeek()).thenReturn(false); assertThat(strategy.isPreAllocateLength(task)).isFalse(); }