docs: @SuppressWarnings("unchecked")
      public Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit) {
  
          logger.debug("Initiate shutdown ({}, {}, {})", quietPeriod, timeout, timeUnit);
  
          shutdownCalled = true;
          DefaultPromise<Boolean> overall = new DefaultPromise<Boolean>(GlobalEventExecutor.INSTANCE);
          DefaultPromise<Boolean> lastRelease = new DefaultPromise<Boolean>(GlobalEventExecutor.INSTANCE);
          Futures.PromiseAggregator<Boolean, Promise<Boolean>> aggregator = new Futures.PromiseAggregator<Boolean, Promise<Boolean>>(
                  overall);
  
          aggregator.expectMore(1);
  
          if (!sharedEventLoopGroupProvider) {
              aggregator.expectMore(1);
          }
  
          if (!sharedEventExecutor) {
              aggregator.expectMore(1);
          }
  
          aggregator.arm();
  
          if (metricEventPublisher != null) {
              metricEventPublisher.shutdown();
          }
  
          if (!sharedTimer) {
              timer.stop();
          }
  
          if (!sharedEventLoopGroupProvider) {
              Future<Boolean> shutdown = eventLoopGroupProvider.shutdown(quietPeriod, timeout, timeUnit);
              if (shutdown instanceof Promise) {
                  aggregator.add((Promise<Boolean>) shutdown);
              } else {
                  aggregator.add(toBooleanPromise(shutdown));
              }
          }
  
          if (!sharedEventExecutor) {
              Future<?> shutdown = eventExecutorGroup.shutdownGracefully(quietPeriod, timeout, timeUnit);
              aggregator.add(toBooleanPromise(shutdown));
          }
  
          if (!sharedCommandLatencyCollector) {
              commandLatencyCollector.shutdown();
          }
  
          aggregator.add(lastRelease);
          lastRelease.setSuccess(null);
  
          return toBooleanPromise(overall);
      }