### Question:
DownloadSerialQueue extends DownloadListener2 implements Runnable { public void setListener(DownloadListener listener) { listenerBunch = new DownloadListenerBunch.Builder() .append(this) .append(listener).build(); } 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 setListener() { assertThat(serialQueue.listenerBunch.contain(listener)).isTrue(); final DownloadListener anotherListener = mock(DownloadListener.class); serialQueue.setListener(anotherListener); assertThat(serialQueue.listenerBunch.contain(listener)).isFalse(); assertThat(serialQueue.listenerBunch.contain(anotherListener)).isTrue(); }