code: @SuppressWarnings({"unchecked"})
    public Completable shutdown() {
      Observable<Boolean> loopShutdown = Observable.empty();
  
      if (eventLoopGroupIsPrivate) {
        loopShutdown = Completable.create(new Completable.OnSubscribe() {
          @Override
          public void call(final CompletableSubscriber subscriber) {
            eventLoopGroup.shutdownGracefully(0, 10, TimeUnit.MILLISECONDS).addListener(
                new GenericFutureListener() {
                  @Override
                  public void operationComplete(Future future) throws Exception {
                    if (future.isSuccess()) {
                      subscriber.onCompleted();
                    } else {
                      subscriber.onError(future.cause());
                    }
                  }
                });
          }
        }).toObservable();
      }
      return Observable.merge(schedulerShutdownHook.shutdown(), loopShutdown)
          .reduce(true, (previous, current) -> previous && current)
          .toCompletable();
    }
docs: Shut down this stateful environment.
  <p>
  Note that it will only release/terminate resources which are owned by the client,
  especially if a custom event loop group is passed in it needs to be shut down
  separately.
  
  @return a {@link Completable} indicating completion of the shutdown process.