### Question:
TaskEventDispatcher { public void clearAll() { synchronized (registeredHandlers) { registeredHandlers.clear(); } }  void registerPartition(ResultPartitionID partitionId); void unregisterPartition(ResultPartitionID partitionId); void subscribeToEvent(
			ResultPartitionID partitionId,
			EventListener<TaskEvent> eventListener,
			Class<? extends TaskEvent> eventType); boolean publish(ResultPartitionID partitionId, TaskEvent event); void clearAll();  }### Answer:
@Test public void clearAll() throws Exception { ResultPartitionID partitionId = new ResultPartitionID(); TaskEventDispatcher ted = new TaskEventDispatcher(); ted.registerPartition(partitionId); ZeroShotEventListener eventListener1 = new ZeroShotEventListener(); ted.subscribeToEvent(partitionId, eventListener1, AllWorkersDoneEvent.class); ted.clearAll(); assertFalse(ted.publish(partitionId, new AllWorkersDoneEvent())); }