### Question:
WebSocketEventHandler implements Consumer<KieServerControllerEvent> { @Override public void accept(final KieServerControllerEvent event) { LOGGER.debug("Handling Kie Server Controller event: {}", event); if (event instanceof ServerInstanceConnected) { handler.onServerInstanceConnected((ServerInstanceConnected)event); } else if(event instanceof ServerInstanceDeleted){ handler.onServerInstanceDeleted((ServerInstanceDeleted)event); } else if(event instanceof ServerInstanceDisconnected){ handler.onServerInstanceDisconnected((ServerInstanceDisconnected)event); } else if(event instanceof ServerInstanceUpdated){ handler.onServerInstanceUpdated((ServerInstanceUpdated)event); } else if(event instanceof ServerTemplateDeleted){ handler.onServerTemplateDeleted((ServerTemplateDeleted)event); } else if(event instanceof ServerTemplateUpdated){ handler.onServerTemplateUpdated((ServerTemplateUpdated)event); } else if(event instanceof ContainerSpecUpdated){ handler.onContainerSpecUpdated((ContainerSpecUpdated)event); } else { LOGGER.warn("Unable to handle Kie Server Controller event: {}", event); } } WebSocketEventHandler(final EventHandler handler); @Override void accept(final KieServerControllerEvent event);  }### Answer:
@Test public void testInvalidEvent() { handler.accept(mock(KieServerControllerEvent.class)); verifyZeroInteractions(eventHandler); }
@Test public void testServerInstanceConnected() { handler.accept(new ServerInstanceConnected(new ServerInstance())); verify(eventHandler).onServerInstanceConnected(any()); verifyNoMoreInteractions(eventHandler); }
@Test public void testServerInstanceDisconnected() { handler.accept(new ServerInstanceDisconnected("serverId")); verify(eventHandler).onServerInstanceDisconnected(any()); verifyNoMoreInteractions(eventHandler); }
@Test public void testServerInstanceDeleted() { handler.accept(new ServerInstanceDeleted("serverId")); verify(eventHandler).onServerInstanceDeleted(any()); verifyNoMoreInteractions(eventHandler); }
@Test public void testServerInstanceUpdated() { handler.accept(new ServerInstanceUpdated(new ServerInstance())); verify(eventHandler).onServerInstanceUpdated(any()); verifyNoMoreInteractions(eventHandler); }
@Test public void testServerTemplateUpdated() { handler.accept(new ServerTemplateUpdated(new ServerTemplate())); verify(eventHandler).onServerTemplateUpdated(any()); verifyNoMoreInteractions(eventHandler); }
@Test public void testServerTemplateDeleted() { handler.accept(new ServerTemplateDeleted("serverTemplateId")); verify(eventHandler).onServerTemplateDeleted(any()); verifyNoMoreInteractions(eventHandler); }
@Test public void testContainerSpecUpdated() { handler.accept(new ContainerSpecUpdated(new ServerTemplate(), new ContainerSpec(), new ArrayList<>())); verify(eventHandler).onContainerSpecUpdated(any()); verifyNoMoreInteractions(eventHandler); }