### Question:
StorageServerChannelManager implements AutoCloseable { public StorageServerChannel getOrCreateChannel(Endpoint endpoint) { StorageServerChannel channel = getChannel(endpoint); if (null != channel) { return channel; } StorageServerChannel newChannel = channelFactory.apply(endpoint); addStorageServer(endpoint, newChannel); return getChannel(endpoint); } StorageServerChannelManager(StorageClientSettings settings); @VisibleForTesting  StorageServerChannelManager(Function<Endpoint, StorageServerChannel> channelFactory); boolean addStorageServer(Endpoint endpoint, StorageServerChannel channel); StorageServerChannel getOrCreateChannel(Endpoint endpoint); @Nullable StorageServerChannel getChannel(Endpoint endpoint); @Nullable StorageServerChannel removeChannel(Endpoint endpoint, StorageServerChannel channel); @Override void close();  }### Answer:
@Test public void testGetOrCreateChannel() { StorageServerChannel channel = channelManager.getOrCreateChannel(endpoint1); assertTrue(channel == channel1); channel = channelManager.getOrCreateChannel(endpoint2); assertTrue(channel == channel2); channel = channelManager.getOrCreateChannel(endpoint3); assertTrue(channel != channel1 && channel != channel2); assertEquals(3, channelManager.getNumChannels()); channelManager.close(); assertEquals(0, channelManager.getNumChannels()); verify(channel1, times(1)).close(); verify(channel2, times(1)).close(); verify(channel, times(1)).close(); }