### Question:
EventDispatcher { public void dispatchRequestEvent(Event event) { XRayHandlerInterface xrayHandler = getHandler(event); if (xrayHandler != null) { xrayHandler.handleRequest(event); } } EventDispatcher(); void addHandler(String origin, XRayHandlerInterface handler); void dispatchRequestEvent(Event event); void dispatchResponseEvent(Event event);  }### Answer:
@Test public void testDispatchRequest() { ServiceActivityRequestEvent serviceRequestEvent = new ServiceActivityRequestEvent(ORIGIN, SERVICE, OPERATION); eventDispatcher.dispatchRequestEvent(serviceRequestEvent); verify(mockHandler, times(1)).handleRequest(serviceRequestEvent); }
@Test public void testDispatchNoHandler() { ServiceActivityRequestEvent serviceRequestEvent = new ServiceActivityRequestEvent("NotUsedOrigin", null, null); eventDispatcher.dispatchRequestEvent(serviceRequestEvent); verify(mockHandler, times(0)).handleRequest(serviceRequestEvent); }