ChannelPool extends ManagedChannel { static ChannelPool create(int poolSize, final ChannelFactory channelFactory) throws IOException { List<ManagedChannel> channels = new ArrayList<>(); for (int i = 0; i < poolSize; i++) { channels.add(channelFactory.createSingleChannel()); } return new ChannelPool(channels, null); } private  ChannelPool(
      List<ManagedChannel> channels,
      @Nullable ScheduledExecutorService channelRefreshExecutorService); @Override String authority(); @Override ClientCall<ReqT, RespT> newCall(
      MethodDescriptor<ReqT, RespT> methodDescriptor, CallOptions callOptions); @Override ManagedChannel shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override ManagedChannel shutdownNow(); @Override boolean awaitTermination(long timeout, TimeUnit unit);  }
@Test public void channelPrimerShouldCallPoolConstruction() throws IOException { ChannelPrimer mockChannelPrimer = Mockito.mock(ChannelPrimer.class); ManagedChannel channel1 = Mockito.mock(ManagedChannel.class); ManagedChannel channel2 = Mockito.mock(ManagedChannel.class); ChannelPool.create( 2, new FakeChannelFactory(Arrays.asList(channel1, channel2), mockChannelPrimer)); Mockito.verify(mockChannelPrimer, Mockito.times(2)) .primeChannel(Mockito.any(ManagedChannel.class)); }