docs: public void prepareForShutdown() {
          Collection<CompletableFuture<Void>> prepareShutdownFutures = shutdownListeners.stream()
                                                                                        .map(shutdownListener -> CompletableFuture.runAsync(() -> shutdownListener.prepareForShutdown()))
                                                                                        .collect(Collectors.toList());
          try {
              CompletableFuture.allOf(prepareShutdownFutures.toArray(new CompletableFuture[prepareShutdownFutures.size()]))
                               .get(prepareForShutdownTimeoutSec, TimeUnit.SECONDS);
          } catch (Exception e) {
              logger.error("Exception occurred while preparing shutdown.", e);
          }
      }