### Question:
NodeManager implements EventHandler { public boolean isNodeAlive(NodeHandler nodeHandler) { return nodeHandler.getState().equals(State.ALIVE) || nodeHandler.getState().equals(State.ACTIVE) || nodeHandler.getState().equals(State.EVICTCANDIDATE); } @Autowired  NodeManager(ChainBaseManager chainBaseManager); ScheduledExecutorService getPongTimer(); @Override void channelActivated(); boolean isNodeAlive(NodeHandler nodeHandler); void setMessageSender(Consumer<UdpEvent> messageSender); NodeHandler getNodeHandler(Node n); boolean hasNodeHandler(Node n); NodeTable getTable(); NodeStatistics getNodeStatistics(Node n); @Override void handleEvent(UdpEvent udpEvent); void sendOutbound(UdpEvent udpEvent); List<NodeHandler> getNodes(Predicate<NodeHandler> predicate, int limit); List<NodeHandler> dumpActiveNodes(); Node getPublicHomeNode(); void close();  }### Answer:
@Test public void isNodeAliveTest() { Node node = new Node(new byte[64], "128.0.0.1", 18888, 18888); nodeManager.getTable().addNode(node); NodeHandler nodeHandler = new NodeHandler(node, nodeManager); nodeHandler.changeState(NodeHandler.State.ACTIVE); Assert.assertTrue(nodeManager.isNodeAlive(nodeHandler)); nodeHandler.changeState(NodeHandler.State.ALIVE); Assert.assertTrue(nodeManager.isNodeAlive(nodeHandler)); nodeHandler.changeState(NodeHandler.State.EVICTCANDIDATE); Assert.assertTrue(nodeManager.isNodeAlive(nodeHandler)); }