EventBus should use generics, such that it becomes an EventBus<T>.
The requirement to provide the class literal should be voided.
Example implementation:
- Add a method
getEventBus() to EventBusFactory, which infers the type T, this should create an instance of EventBus<T>, if possible without explicitely supplying T.class.
- As a result both
SimpleEventBus and VoidEventBus become private static inner classes of EventBusFactory.
It is imperative that the unit tests should be updated accordingly aswell.