### Question:
StorageContainerProxyChannelManagerImpl implements StorageContainerProxyChannelManager { @Override public Channel getStorageContainerChannel(long scId) { StorageContainerChannel channel = ssClientManager.getStorageContainerChannel(scId); CompletableFuture<StorageServerChannel> serverChannelFuture = channel.getStorageContainerChannelFuture(); if (null != serverChannelFuture && serverChannelFuture.isDone()) { StorageServerChannel serverChannel = serverChannelFuture.join(); if (serverChannel != null) { return serverChannel.getGrpcChannel(); } else { return null; } } else { return null; } } StorageContainerProxyChannelManagerImpl(StorageServerClientManager clientManager); @Override Channel getStorageContainerChannel(long scId);  }### Answer:
@Test public void testGetStorageContainerChannel() throws Exception { final CompletableFuture<GetStorageContainerEndpointRequest> receivedRequest = new CompletableFuture<>(); final CompletableFuture<GetStorageContainerEndpointResponse> responseSupplier = new CompletableFuture<>(); StorageContainerServiceImplBase scService = new StorageContainerServiceImplBase() { @Override public void getStorageContainerEndpoint( GetStorageContainerEndpointRequest request, StreamObserver<GetStorageContainerEndpointResponse> responseObserver) { receivedRequest.complete(request); try { responseObserver.onNext(responseSupplier.get()); responseObserver.onCompleted(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); responseObserver.onError(e); } catch (ExecutionException e) { responseObserver.onError(e); } } }; serviceRegistry.addService(scService.bindService()); Channel channel = proxyChannelManager.getStorageContainerChannel(scId); assertNull(channel); responseSupplier.complete(getResponse(receivedRequest.get())); while ((channel = proxyChannelManager.getStorageContainerChannel(scId)) == null) { TimeUnit.MILLISECONDS.sleep(100); } assertNotNull(channel); }