### Question:
QueryEventHandlerContext { public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent()); handler.handle(event); } else { LOGGER.info("No handler found for event: " + event.getEventType().name() + ". Ignoring event"); } } } } QueryEventHandlerContext(Set<QueryEventHandler> handlers); void handle(CloudRuntimeEvent<?, ?>... events);  }### Answer:
@Test public void handleShouldSelectHandlerBasedOnEventType() { CloudTaskCreatedEvent event = new CloudTaskCreatedEventImpl(); context.handle(event); verify(handler).handle(event); }
@Test public void handleShouldDoNothingWhenNoHandlerIsFoundForTheGivenEvent() { CloudTaskCompletedEvent event = new CloudTaskCompletedEventImpl(); context.handle(event); verify(handler, never()).handle(any()); }