### Question:
ContainerActionsHandler implements
    EventHandler<ContainerActionsFromDatanode> { @Override public void onMessage( ContainerActionsFromDatanode containerReportFromDatanode, EventPublisher publisher) { DatanodeDetails dd = containerReportFromDatanode.getDatanodeDetails(); for (ContainerAction action : containerReportFromDatanode.getReport() .getContainerActionsList()) { ContainerID containerId = ContainerID.valueof(action.getContainerID()); switch (action.getAction()) { case CLOSE: if (LOG.isDebugEnabled()) { LOG.debug("Closing container {} in datanode {} because the" + " container is {}.", containerId, dd, action.getReason()); } publisher.fireEvent(SCMEvents.CLOSE_CONTAINER, containerId); break; default: LOG.warn("Invalid action {} with reason {}, from datanode {}. ", action.getAction(), action.getReason(), dd); } } }  @Override void onMessage(
      ContainerActionsFromDatanode containerReportFromDatanode,
      EventPublisher publisher);  }### Answer:
@Test public void testCloseContainerAction() { EventQueue queue = new EventQueue(); ContainerActionsHandler actionsHandler = new ContainerActionsHandler(); CloseContainerEventHandler closeContainerEventHandler = Mockito.mock( CloseContainerEventHandler.class); queue.addHandler(SCMEvents.CLOSE_CONTAINER, closeContainerEventHandler); queue.addHandler(SCMEvents.CONTAINER_ACTIONS, actionsHandler); ContainerAction action = ContainerAction.newBuilder() .setContainerID(1L) .setAction(ContainerAction.Action.CLOSE) .setReason(ContainerAction.Reason.CONTAINER_FULL) .build(); ContainerActionsProto cap = ContainerActionsProto.newBuilder() .addContainerActions(action) .build(); ContainerActionsFromDatanode containerActions = new ContainerActionsFromDatanode( MockDatanodeDetails.randomDatanodeDetails(), cap); queue.fireEvent(SCMEvents.CONTAINER_ACTIONS, containerActions); queue.processAll(1000L); verify(closeContainerEventHandler, times(1)) .onMessage(ContainerID.valueof(1L), queue); }