@Test public void forwardsCalls() { AutoConfiguredLoadBalancer lb = (AutoConfiguredLoadBalancer) lbf.newLoadBalancer(new TestHelper()); final AtomicInteger calls = new AtomicInteger(); TestLoadBalancer testlb = new TestLoadBalancer() { @Override public void handleNameResolutionError(Status error) { calls.getAndSet(1); } @Override public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) { calls.getAndSet(2); } @Override public void shutdown() { calls.getAndSet(3); } }; lb.setDelegate(testlb); lb.handleNameResolutionError(Status.RESOURCE_EXHAUSTED); assertThat(calls.getAndSet(0)).isEqualTo(1); lb.handleSubchannelState(null, null); assertThat(calls.getAndSet(0)).isEqualTo(2); lb.shutdown(); assertThat(calls.getAndSet(0)).isEqualTo(3); }
@Override public LoadBalancer newLoadBalancer(Helper helper) { return new AutoConfiguredLoadBalancer(helper); }
AutoConfiguredLoadBalancerFactory extends LoadBalancer.Factory { @Override public LoadBalancer newLoadBalancer(Helper helper) { return new AutoConfiguredLoadBalancer(helper); } }
AutoConfiguredLoadBalancerFactory extends LoadBalancer.Factory { @Override public LoadBalancer newLoadBalancer(Helper helper) { return new AutoConfiguredLoadBalancer(helper); }  }
AutoConfiguredLoadBalancerFactory extends LoadBalancer.Factory { @Override public LoadBalancer newLoadBalancer(Helper helper) { return new AutoConfiguredLoadBalancer(helper); }  @Override LoadBalancer newLoadBalancer(Helper helper); }
AutoConfiguredLoadBalancerFactory extends LoadBalancer.Factory { @Override public LoadBalancer newLoadBalancer(Helper helper) { return new AutoConfiguredLoadBalancer(helper); }  @Override LoadBalancer newLoadBalancer(Helper helper);  }