### Question:
ThriftDcBalancer implements Balancer<NodeStatus<I, C>>, Closeable { public void setDcNodes(List<NodeStatus<I, C>> ring, int totalNodeCount){ hasChangesInRing = true; this.nodesInRing = totalNodeCount; @SuppressWarnings("unchecked") List<NodeStatus<I, C>> ringCopy = new ArrayList<>(ring); Collections.sort(ringCopy, Comparator.comparing(NodeStatus::getAddress)); int maxConnections = (int)Math.ceil(config.getMaxConnections() / (double)nodesInRing); ringCopy.forEach(node -> node.setMaxConnections(maxConnections)); allDcNodes = ringCopy; balancerRecovery = createBalancer(ringCopy, BalancerType.RECOVERY); } protected  ThriftDcBalancer(String serviceName, String dcName, ThriftBalancerConfig config); void setDcNodes(List<NodeStatus<I, C>> ring, int totalNodeCount); void doHealthCheck(); @Override void reBalance(); boolean isWorking(); boolean canProcessRequests(); @Override Optional<NodeStatus<I, C>> get(); Optional<NodeStatus<I, C>> getRecover(); @Override Stream<NodeStatus<I, C>> nodes(); String getDcName(); LoadBasedBalancer.LoadAccumulator<ThriftDcBalancer<I, C>> getLoadAccumulator(); double getLoad(); int getUsedConnections(); int getOpenConnections(); @Override void close(); long getFailNodesCount(); String getStatus(); void reconfigure(ThriftBalancerConfig config);  }### Answer:
@Test(groups = "unit") public void setDcNodes() throws Exception { assertTrue(balancer.getRecover().isPresent()); assertTrue(balancer.get().isPresent()); balancer.setDcNodes(Collections.emptyList(), 5); balancer.reBalance(); assertFalse(balancer.getRecover().isPresent()); assertTrue(balancer.get().isPresent()); verify(node2).setMaxConnections(22); }