public void testFireEventFromSource() {
Object source1 = new Object();
Object source2 = new Object();
eventBus.fireEvent(new FooEvent());
checkSourceEvents(0, FooEvent.TYPE, source1);
checkSourceEvents(0, FooEvent.TYPE, source2);
checkTotalEvents(1, FooEvent.TYPE);
eventBus.fireEventFromSource(new FooEvent(), source1);
checkSourceEvents(1, FooEvent.TYPE, source1);
checkSourceEvents(0, FooEvent.TYPE, source2);
checkSourceEvents(1, FooEvent.TYPE, null);
assertEquals(2, eventBus.getFiredCount(FooEvent.TYPE));
eventBus.fireEventFromSource(new FooEvent(), source1);
checkSourceEvents(2, FooEvent.TYPE, source1);
checkSourceEvents(0, FooEvent.TYPE, source2);
checkSourceEvents(1, FooEvent.TYPE, null);
assertEquals(3, eventBus.getFiredCount(FooEvent.TYPE));
eventBus.fireEventFromSource(new FooEvent(), source2);
checkSourceEvents(2, FooEvent.TYPE, source1);
checkSourceEvents(1, FooEvent.TYPE, source2);
checkSourceEvents(1, FooEvent.TYPE, null);
assertEquals(4, eventBus.getFiredCount(FooEvent.TYPE));