### Question:
NodeConnection extends Connection<Client> { @TimerJ public void close() { if (node != null) { node.close(); node = null; elasticClient = null; logger.info("ElasticSearch connection [" + connectionName + "] close"); } } NodeConnection(ICredentials credentials, ConnectorClusterConfig config); @TimerJ void close(); @Override @TimerJ boolean isConnected(); @Override @TimerJ Client getNativeConnection();  }### Answer:
@Test public void testClose() throws Exception { Whitebox.setInternalState(nodeConnection, "elasticClient", client); Whitebox.setInternalState(nodeConnection, "node", node); nodeConnection.close(); verify(node, times(1)).close(); assertNull("The connection is null", Whitebox.getInternalState(nodeConnection, "elasticClient")); assertNull("The node is null", Whitebox.getInternalState(nodeConnection, "node")); }