### Question:
UnifiedListenerManager { public synchronized void addAutoRemoveListenersWhenTaskEnd(int id) { if (autoRemoveListenerIdList.contains(id)) return; autoRemoveListenerIdList.add(id); } UnifiedListenerManager(); synchronized void detachListener(int id); synchronized void addAutoRemoveListenersWhenTaskEnd(int id); synchronized void removeAutoRemoveListenersWhenTaskEnd(int id); synchronized void detachListener(DownloadListener listener); synchronized boolean detachListener(@NonNull DownloadTask task,
                                               DownloadListener listener); synchronized void attachListener(@NonNull DownloadTask task,
                                            @NonNull DownloadListener listener); synchronized void attachAndEnqueueIfNotRun(@NonNull DownloadTask task,
                                                      @NonNull DownloadListener listener); synchronized void enqueueTaskWithUnifiedListener(@NonNull DownloadTask task,
                                                            @NonNull DownloadListener listener); synchronized void executeTaskWithUnifiedListener(@NonNull DownloadTask task,
                                                            @NonNull DownloadListener listener); @NonNull DownloadListener getHostListener();  }### Answer:
@Test public void addAutoRemoveListenersWhenTaskEnd() { listenerManager.addAutoRemoveListenersWhenTaskEnd(1); listenerManager.addAutoRemoveListenersWhenTaskEnd(1); assertThat(listenerManager.autoRemoveListenerIdList).containsExactly(1); }