DefaultRawMemcacheClient extends AbstractRawMemcacheClient { @Override public void shutdown() { setDisconnected("Shutdown"); } private  DefaultRawMemcacheClient(
      final HostAndPort address,
      final Channel channel,
      final int outstandingRequestLimit,
      final int batchSize,
      final Executor executor,
      final long connectionTimeoutMillis,
      final Metrics metrics,
      int maxSetLength); static CompletionStage<RawMemcacheClient> connect(
      final HostAndPort address,
      final int outstandingRequestLimit,
      final int batchSize,
      final boolean binary,
      final Executor executor,
      final long connectionTimeoutMillis,
      final Charset charset,
      final Metrics metrics,
      final int maxSetLength,
      final EventLoopGroup eventLoopGroup,
      final Class<? extends Channel> channelClass); @Override @SuppressWarnings("unchecked") CompletionStage<T> send(final Request<T> request); @Override void shutdown(); @Override boolean isConnected(); @Override Throwable getConnectionFailure(); @Override int numTotalConnections(); @Override int numActiveConnections(); @Override String toString();  }
@Test public void testShutdown() throws Exception { final ServerSocket server = new ServerSocket(); server.bind(null); final HostAndPort address = HostAndPort.fromParts("127.0.0.1", server.getLocalPort()); RawMemcacheClient rawClient = DefaultRawMemcacheClient.connect( address, 5000, BATCH_SIZE, false, null, 1000, StandardCharsets.UTF_8, new NoopMetrics(), 1024 * 1024, null, null) .toCompletableFuture() .get(); rawClient.shutdown(); rawClient.awaitDisconnected(10, TimeUnit.SECONDS); assertFalse(rawClient.isConnected()); }