### Question:
MinaMessageQueue extends IoHandlerAdapter implements MessageQueue { public final void setUpMessageClient(List<String> messageServerIds) { ArrayList<String> servers = new ArrayList<String>(messageServerIds); Collections.sort(servers); Set<String> serverKeySet = messageClientMap.keySet(); for ( String serverKey : serverKeySet ) { int index = Collections.binarySearch(servers, serverKey); if ( index < 0 ) { MessageClient client = messageClientMap.remove(serverKey); if ( client != null ) { client.disconnectFromServer(); client = null; } if ( logger.isDebugEnabled() ) { logger.debug("Remove a obsolete MessageServer: " + serverKey); } } } for ( String messageServerId : servers ) { if ( localMessageServerId.equals(messageServerId) ) { if ( logger.isDebugEnabled() ) { logger.debug("Ignore same JVM MessageServer: " + messageServerId); } continue; } MessageClient client = messageClientMap.get(messageServerId); if ( client == null ) { client = setUpSingleMessageClient(messageServerId); } else { if ( logger.isDebugEnabled() ) { logger.debug("The connection to MessageServer: " + messageServerId + " is already open"); } } } } MinaMessageQueue(); @Override final void initQueue(); @Override final void destroyQueue(); final void setUpMessageClient(List<String> messageServerIds); MessageClient setUpSingleMessageClient(String messageServerId); static MessageQueue getInstance(); @Override void exceptionCaught(IoSession session, Throwable cause); @Override void sessionWrite(IoSession session, Object message, SessionKey sessionKey); @Override void sessionWrite(SessionKey sessionKey, Object message); @Override IoSession findSession(SessionKey sessionKey);  }### Answer:
@Test public void testSetUpMessageClient() throws Exception { try { MinaMessageQueue messageQueue = (MinaMessageQueue)MinaMessageQueue.getInstance(); ConcurrentHashMap<String, MessageClient> messageClientMap = (ConcurrentHashMap<String, MessageClient>) TestUtil.getPrivateFieldValue("messageClientMap", messageQueue); ArrayList<String> serverList = new ArrayList<String>(); messageQueue.setUpMessageClient(serverList); assertEquals(0, messageClientMap.keySet().size()); } catch (Exception e) { e.printStackTrace(); } }