### Question:
NodesHolder implements Closeable { @Override public void close() { synchronized (loadNodesLock) { for (ThriftDcBalancer<I, C> dc : dataCenters.values()) { if (metricStatus.isEnabled()) { ThriftMonitoring.getMonitor().unRegisterDc(serviceName, dc.getDcName()); } dc.close(); } Stream.concat( toClose.values().stream(), nodes.values().stream() ).forEach(status -> { if (metricStatus.isEnabled()) { ThriftMonitoring.getMonitor().unRegisterNode(serviceName, status.getAddress()); } status.close(); }); } } protected  NodesHolder(
            Function<ThriftClientConfig, C> clientFactory,
            String serviceName
    ); void reloadNodes(boolean initialCreate); @Override void close(); List<ThriftDcBalancer<I, C>> getDcList(); List<NodeStatus<I, C>> getFullNodeList(); void reconfigure(ThriftBalancerConfig config); static final int INIT_CONNECTIONS_COUNT; }### Answer:
@Test(groups = "unit") public void close() throws Exception { holder.reloadNodes(true); when(config.getServersSupplier()).thenReturn(() -> new HashSet<>(Arrays.asList(address1dc1, address3dc2))); holder.reloadNodes(true); holder.close(); verify(node1dc1).close(); verify(node2dc1).close(); verify(node3dc2).close(); }