### Question:
EventManager { public void trigger(Object event){ Set<Class> eventTypes = getAllInheritedClasses(event.getClass()); for (Class eventType : eventTypes) { if(observers.containsKey(eventType)){ for (EventObserver eventObserver : observers.get(eventType)) { executionQueue.get().add(new EventExecution(event, eventObserver)); } } } triggerQueue(); }  void register(Class<T> event, EventObserver<T> observer); void trigger(Object event); void unregister(EventObserver<?> observer);  }### Answer:
@Test public void testRegistration(){ registerEvents(); ObservesEvent event = new ObservesEvent(); eventManager.trigger(event); assertEquals(event, target.getEvent()); assertEquals(event, target.getObjectEvent()); }
@Test public void testEventHierarchyTrigger(){ registerEvents(); Object event = new Object(); eventManager.trigger(event); assertNull(target.getEvent()); assertEquals(event, target.getObjectEvent()); }