### Question:
Events { public void unsubscribe(Object topic) { subscriptions.remove(topic); }  void subscribe(Object token, Consumer<T> consumer); void unsubscribe(Object topic); void unsubscribe(Object topic, Consumer<T> consumer); void publish(Object topic, T payload); @SuppressWarnings({ "unchecked", "rawtypes" }) void tick();  }### Answer:
@Test public void testUnsubscribe() { Consumer<String> consumer1 = stringConsumerMock(); Consumer<String> consumer2 = stringConsumerMock(); events.subscribe(TOKEN, consumer1); events.subscribe(TOKEN, consumer2); events.unsubscribe(TOKEN, consumer1); events.publish(TOKEN, "hello"); events.tick(); Mockito.verifyZeroInteractions(consumer1); Mockito.verify(consumer2) .accept("hello"); }