### Question:
EventDispatcher { static public void fireEvent(Event event) { if (null == event) { throw new IllegalArgumentException(); } for (AbstractEventListener listener : getEntry(event.getClass()).listeners) { try { listener.onEvent(event); } catch (Exception e) { log.error(e.toString(), e); } } }  static void addEventListener(AbstractEventListener listener); static void fireEvent(Event event); static void clear();  }### Answer:
@Test public void testFireEvent() { EventDispatcher.fireEvent(new MockEvent()); assertEquals(0, MockListener.count); EventDispatcher.addEventListener(new MockListener()); EventDispatcher.fireEvent(new MockEvent()); assertEquals(1, MockListener.count); EventDispatcher.fireEvent(new MockEvent()); assertEquals(2, MockListener.count); }