code: public static CompletableFuture<Void> stopAsync(Service service, Executor executor) {
          // Service.stopAsync() will not throw any exceptions, but will transition the Service to either TERMINATED
          // or FAILED. We need to register the listener before we attempt to stop.
          CompletableFuture<Void> result = new CompletableFuture<>();
          onStop(service, () -> result.complete(null), result::completeExceptionally, executor);
          service.stopAsync();
          return result;
      }
docs: Asynchronously stops a Service and returns a CompletableFuture that will indicate when it is stopped.
  
  @param service  The Service to stop.
  @param executor An Executor to use for callback invocations.
  @return A CompletableFuture that will be completed when the service enters a TERMINATED state, or completed
  exceptionally if the service enters a FAILED state.