MarketEventHandlerImpl implements MarketEventCallback<T> { @Override public void onMarketEvent(TradeableInstrument<T> instrument, double bid, double ask, DateTime eventDate) { MarketDataPayLoad<T> payload = new MarketDataPayLoad<T>(instrument, bid, ask, eventDate); eventBus.post(payload); } MarketEventHandlerImpl(EventBus eventBus); @Override void onMarketEvent(TradeableInstrument<T> instrument, double bid, double ask, DateTime eventDate);  }
@Test public void testRideEventBus() throws Exception { EventBus evtBus = new AsyncEventBus(Executors.newFixedThreadPool(numSubscribers)); for (int i = 1; i <= numSubscribers; i++) { evtBus.register(new MarketDataSubscriber()); } MarketEventCallback<String> callback = new MarketEventHandlerImpl<String>(evtBus); callback.onMarketEvent(new TradeableInstrument<String>(gbpusd), bid, ask, DateTime.now()); done.await(); }