### Question:
EventBus { public void unregister(Object object) { listeners.remove(object); }  void post(Notification event); void register(Object object); void unregister(Object object);  }### Answer:
@Test public void unregister() throws Exception { register(); bus.unregister(sub); TestEvent e = new TestEvent(); bus.post(e); assertEquals("There should be only one event received", 1, sub.eventsReceived.size()); assertNotEquals("The event received should not be the latest one sent", e, sub .eventsReceived.get(0)); }