#vulnerable code 
                              @Test
  public void testChannelsAreRoundRobinned() throws IOException {
    MockChannelFactory factory = new MockChannelFactory();
    MethodDescriptor descriptor = mock(MethodDescriptor.class);
    MockitoAnnotations.initMocks(this);
    ChannelPool pool = new ChannelPool(null, factory);
    pool.ensureChannelCount(2);
    pool.newCall(descriptor, CallOptions.DEFAULT);
    verify(factory.channels.get(0), times(1)).newCall(same(descriptor), same(CallOptions.DEFAULT));
    verify(factory.channels.get(1), times(0)).newCall(same(descriptor), same(CallOptions.DEFAULT));
    pool.newCall(descriptor, CallOptions.DEFAULT);
    verify(factory.channels.get(0), times(1)).newCall(same(descriptor), same(CallOptions.DEFAULT));
    verify(factory.channels.get(1), times(1)).newCall(same(descriptor), same(CallOptions.DEFAULT));
  } 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test
  public void testChannelsAreRoundRobinned() throws IOException {
    MockChannelFactory factory = new MockChannelFactory();
    MethodDescriptor descriptor = mock(MethodDescriptor.class);
    MockitoAnnotations.initMocks(this);
    ChannelPool pool = new ChannelPool(null, factory);
    pool.ensureChannelCount(2);
    pool.newCall(descriptor, CallOptions.DEFAULT);
    verify(factory.channels.get(0), times(1)).newCall(same(descriptor), same(CallOptions.DEFAULT));
    verify(factory.channels.get(1), times(0)).newCall(same(descriptor), same(CallOptions.DEFAULT));
    pool.newCall(descriptor, CallOptions.DEFAULT);
    verify(factory.channels.get(0), times(1)).newCall(same(descriptor), same(CallOptions.DEFAULT));
    verify(factory.channels.get(1), times(1)).newCall(same(descriptor), same(CallOptions.DEFAULT));
}