### Question:
EventBus { @SuppressWarnings("unchecked") public void publish(Event event) { try { monitor.lock(); if (subscribers.containsKey(event.getClass())) { eventPublisher.publish((LinkedList<Class<? extends Subscriber>>) subscribers.get(event.getClass()).clone(), event); } } finally { monitor.unlock(); } }  void setEventPublisher(EventPublisher eventPublisher); void subscribe(Class<? extends Subscriber> subscriber); @SuppressWarnings("unchecked") void publish(Event event);  }### Answer:
@SuppressWarnings("unchecked") @Test public void publishTest() { Event event = new EventTwo(); this.publisher.publish(Arrays.asList(SubscriberOne.class, SubscriberTwo.class), event); replay(this.consumerOne, this.consumerTwo, this.publisher); bus.subscribe(SubscriberOne.class); bus.subscribe(SubscriberTwo.class); bus.publish(event); verify(this.consumerOne, this.consumerTwo, this.publisher); }