### Question:
StatusUtil { public static Status getStatus(@NonNull DownloadTask task) { final Status status = isCompletedOrUnknown(task); if (status == Status.COMPLETED) return Status.COMPLETED; final DownloadDispatcher dispatcher = OkDownload.with().downloadDispatcher(); if (dispatcher.isPending(task)) return Status.PENDING; if (dispatcher.isRunning(task)) return Status.RUNNING; return status; }  static boolean isSameTaskPendingOrRunning(@NonNull DownloadTask task); static Status getStatus(@NonNull DownloadTask task); static Status getStatus(@NonNull String url, @NonNull String parentPath,
                                   @Nullable String filename); static boolean isCompleted(@NonNull DownloadTask task); static Status isCompletedOrUnknown(@NonNull DownloadTask task); static boolean isCompleted(@NonNull String url, @NonNull String parentPath,
                                      @Nullable String filename); @Nullable static BreakpointInfo getCurrentInfo(@NonNull String url,
                                                          @NonNull String parentPath,
                                                          @Nullable String filename); @Nullable static BreakpointInfo getCurrentInfo(@NonNull DownloadTask task);  }### Answer:
@Test public void getStatus() throws IOException { file.getParentFile().mkdirs(); file.createNewFile(); assertThat(file.exists()).isTrue(); StatusUtil.Status status = StatusUtil .getStatus(url, file.getParent(), file.getName()); assertThat(status).isEqualTo(COMPLETED); status = StatusUtil.getStatus(url, file.getParentFile().getPath(), null); assertThat(status).isEqualTo(UNKNOWN); final DownloadDispatcher dispatcher = OkDownload.with().downloadDispatcher(); doReturn(true).when(dispatcher).isRunning(any(DownloadTask.class)); status = StatusUtil.getStatus(url, file.getParentFile().getPath(), null); assertThat(status).isEqualTo(RUNNING); doReturn(true).when(dispatcher).isPending(any(DownloadTask.class)); status = StatusUtil.getStatus(url, file.getParentFile().getPath(), null); assertThat(status).isEqualTo(PENDING); }