### Question:
EventManager implements IEventManager { public <E> E getEventHandler(Class<E> eventHandlerClass) { Optional<E> eventHandler = getEventHandlers().stream().filter(h -> h.getClass().getName().equalsIgnoreCase(eventHandlerClass.getName())).map(h -> (E) h).findFirst(); if (eventHandler.isPresent()) { return eventHandler.get(); } throw new RuntimeException("No eventHandler of type " + eventHandlerClass.getName() + " is registered!"); } EventManager(); void registerEventHandler(IEventHandler eventHandler); void autoDiscovery(); void publish(Object event); boolean hasEventHandler(Class eventHandlerClass); E getEventHandler(Class<E> eventHandlerClass); IDisposable onEvent(Class<E> eventClass, Consumer<E> consumer); void setDefaultEventHandler(Class eventHandler); void setDefaultEventHandler(String eventHandler); void close();  }### Answer:
@Test public void testGetEventHandlerByClass() { SimpleEventHandler eventHandler = eventManager.getEventHandler(SimpleEventHandler.class); Assertions.assertNotNull(eventHandler, "should fine a eventHandler for class SimpleEventHandler"); }