docs: @SuppressWarnings({ "rawtypes", "unchecked" })
      public Future<Void> shutdown() {
          final Future<Void> channelCloseFuture = this.allChannels.close();
  
          final Future<Void> disconnectFuture;
  
          if (this.shouldShutDownEventLoopGroup) {
              // Wait for the channel to close before we try to shut down the event loop group
              channelCloseFuture.addListener(new GenericFutureListener<Future<Void>>() {
  
                  @Override
                  public void operationComplete(final Future<Void> future) throws Exception {
                      BaseHttp2Server.this.bootstrap.config().group().shutdownGracefully();
                  }
              });
  
              // Since the termination future for the event loop group is a Future<?> instead of a Future<Void>,
              // we'll need to create our own promise and then notify it when the termination future completes.
              disconnectFuture = new DefaultPromise<>(GlobalEventExecutor.INSTANCE);
  
              this.bootstrap.config().group().terminationFuture().addListener(new GenericFutureListener() {
  
                  @Override
                  public void operationComplete(final Future future) throws Exception {
                      ((Promise<Void>) disconnectFuture).trySuccess(null);
                  }
              });
          } else {
              // We're done once we've closed all the channels, so we can return the closure future directly.
              disconnectFuture = channelCloseFuture;
          }
  
          disconnectFuture.addListener(new GenericFutureListener<Future<Void>>() {
              @Override
              public void operationComplete(final Future<Void> future) throws Exception {
                  if (BaseHttp2Server.this.sslContext instanceof ReferenceCounted) {
                      if (BaseHttp2Server.this.hasReleasedSslContext.compareAndSet(false, true)) {
                          ((ReferenceCounted) BaseHttp2Server.this.sslContext).release();
                      }
                  }
              }
          });
  
          return disconnectFuture;
      }