DeadEventSubscriber { public List<DeadEvent> getDeadEvents() { return deadEvents; } DeadEventSubscriber(EventBus eventBus); @Subscribe void handleUnsubscribedEvent(DeadEvent deadEvent); List<DeadEvent> getDeadEvents();  }
@Test public void testPublishNoSubscribers(){ SellEvent sellEvent = sellEventBuilder().build(); eventBus.post(sellEvent); assertThat(tradeAuditor.getTradeEvents().isEmpty(),is(true)); assertThat(deadEventSubscriber.getDeadEvents().size(),is(1)); SellEvent wrappedSellEvent = (SellEvent)deadEventSubscriber.getDeadEvents().get(0).getEvent(); assertThat(wrappedSellEvent,is(sellEvent)); }