public void testUnregisterSubscriber() {
    bus.register(subscriber);
    bus.post(new Event1("event1"));
    bus.unregister(subscriber);
    subscriber.clearEvents();

    bus.post(new Event1("event1"));
    subscriber.assertNoEvents();
  }
 public void testProducerFirstWithNullEvent() {
   producer.lastEvent = null;
   bus.register(producer);
   bus.register(subscriber);
   subscriber.assertNoEvents();
 }
 public void testUnregisterProducer() {
   bus.register(producer);
   bus.unregister(producer);
   bus.register(subscriber);
   subscriber.assertNoEvents();
 }