### Question:
BoltServer implements Server { @Override public Channel getChannel(InetSocketAddress remoteAddress) { Channel channel = channels.get(NetUtil.toAddressString(remoteAddress)); if (channel != null && channel.isConnected()) { return channel; } return null; } BoltServer(URL url, List<ChannelHandler> channelHandlers); void startServer(); void initServer(); @Override boolean isOpen(); @Override Collection<Channel> getChannels(); @Override Channel getChannel(InetSocketAddress remoteAddress); @Override Channel getChannel(URL url); @Override InetSocketAddress getLocalAddress(); @Override void close(); @Override void close(Channel channel); @Override boolean isClosed(); @Override Object sendSync(Channel channel, Object message, int timeoutMillis); @Override void sendCallback(Channel channel, Object message, CallbackHandler callbackHandler,
                             int timeoutMillis); void addChannel(Channel channel); void removeChannel(Channel channel); RpcServer getRpcServer(); @Override int getChannelCount();  }### Answer:
@Test public void testGetChannel() { BoltServer sessionServer = new BoltServer(null, null); for (int i = 0; i < 30; i++) { int finalI = i; sessionServer.addChannel(new Channel() { @Override public InetSocketAddress getRemoteAddress() { return new InetSocketAddress("192.168.1." + finalI, 9000); } @Override public InetSocketAddress getLocalAddress() { return null; } @Override public boolean isConnected() { return finalI % 2 == 0; } @Override public Object getAttribute(String key) { return null; } @Override public void setAttribute(String key, Object value) { } @Override public WebTarget getWebTarget() { return null; } @Override public void close() { } }); } sessionServer.getChannels(); Channel channel = sessionServer.getChannel(new InetSocketAddress("192.168.1.1", 9000)); Assert.assertNull(channel); channel = sessionServer.getChannel(new InetSocketAddress("192.168.1.18", 9000)); Assert.assertNotNull(channel); }