ReconnectingClient extends AbstractRawMemcacheClient { @Override public void shutdown() { stayConnected = false; client.shutdown(); notifyConnectionChange(); } ReconnectingClient(
      final BackoffFunction backoffFunction,
      final ScheduledExecutorService scheduledExecutorService,
      final HostAndPort address,
      final int outstandingRequestLimit,
      final int batchSize,
      final boolean binary,
      final Authenticator authenticator,
      final Executor executor,
      final long connectionTimeoutMillis,
      final Charset charset,
      final Metrics metrics,
      final int maxSetLength,
      final EventLoopGroup eventLoopGroup,
      final Class<? extends Channel> channelClass); private  ReconnectingClient(
      final BackoffFunction backoffFunction,
      final ScheduledExecutorService scheduledExecutorService,
      final Connector connector,
      final Authenticator authenticator,
      final HostAndPort address);   ReconnectingClient(
      final BackoffFunction backoffFunction,
      final ScheduledExecutorService scheduledExecutorService,
      final com.spotify.folsom.reconnect.Connector connector,
      final HostAndPort address); @Override CompletionStage<T> send(final Request<T> request); @Override void shutdown(); @Override boolean isConnected(); @Override Throwable getConnectionFailure(); @Override int numTotalConnections(); @Override int numActiveConnections(); static ScheduledExecutorService singletonExecutor(); @Override String toString();  }
@Test public void testShutdown() throws Exception { FakeClient delegate = new FakeClient(true, false); BackoffFunction backoffFunction = mock(BackoffFunction.class); when(backoffFunction.getBackoffTimeMillis(0)).thenReturn(0L); when(backoffFunction.getBackoffTimeMillis(1)).thenReturn(123L); Connector connector = mock(Connector.class); when(connector.connect()).thenReturn(CompletableFuture.completedFuture(delegate)); ReconnectingClient client = new ReconnectingClient( backoffFunction, scheduledExecutorService, connector, HostAndPort.fromString("localhost:123")); assertTrue(client.isConnected()); client.shutdown(); client.awaitDisconnected(10, TimeUnit.SECONDS); assertFalse(client.isConnected()); }