### Question:
DownloadSerialQueue extends DownloadListener2 implements Runnable { @Override public synchronized void taskEnd(@NonNull DownloadTask task, @NonNull EndCause cause, @Nullable Exception realCause) { if (cause != EndCause.CANCELED && task == runningTask) runningTask = null; } DownloadSerialQueue();   DownloadSerialQueue(DownloadListener listener, ArrayList<DownloadTask> taskList);  DownloadSerialQueue(DownloadListener listener); void setListener(DownloadListener listener); synchronized void enqueue(DownloadTask task); synchronized void pause(); synchronized void resume(); int getWorkingTaskId(); int getWaitingTaskCount(); synchronized DownloadTask[] shutdown(); @Override void run(); @Override void taskStart(@NonNull DownloadTask task); @Override synchronized void taskEnd(@NonNull DownloadTask task, @NonNull EndCause cause,
                                     @Nullable Exception realCause);  }### Answer:
@Test public void taskEnd() { serialQueue.runningTask = task1; serialQueue.taskEnd(task1, EndCause.COMPLETED, null); assertThat(serialQueue.runningTask).isNull(); }