### Question:
SimpleEventBus implements EventBus { @Override public void broadcast(String event, String data) { for (Map.Entry<String, Subscription> entry : subscriptions.entrySet()) { entry.getValue().onEvent(event, data); } }  @Override Subscription subscribe(String subscriberId, Subscription handler); @Override Subscription unsubscribe(String subscriberId); @Override void broadcast(String event, String data); @Override void send(String subscriberId, String event, String data);  }### Answer:
@Test public void testBroadcast() throws InterruptedException { CountDownLatch done = new CountDownLatch(2); String sub1[] = new String[2]; String sub2[] = new String[2]; EventBus eventBus = createEventBus(); eventBus.subscribe("a", (event, data) -> { sub1[0] = event; sub1[1] = data; done.countDown(); }); eventBus.subscribe("b", (event, data) -> { sub2[0] = event; sub2[1] = data; done.countDown(); }); eventBus.broadcast("text", "data"); done.await(5, TimeUnit.SECONDS); assertEquals("text", sub1[0]); assertEquals("data", sub1[1]); assertEquals("text", sub2[0]); assertEquals("data", sub2[1]); }