docs: public void startAndWait() throws Exception {
      Subscriber subscriber = Subscriber.newBuilder(subscriptionName, receiver).build();
      ExecutorService pool = Executors.newCachedThreadPool();
      subscriber.addListener(
          new Subscriber.Listener() {
            public void failed(Subscriber.State from, Throwable failure) {
              // Handle error.
            }
          },
          pool);
      subscriber.startAsync();
  
      // Wait for a stop signal.
      // In a server, this might be a signal to stop serving.
      // In this example, the signal is just a dummy Future.
      //
      // By default, Subscriber uses daemon threads (see
      // https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html).
      // Consequently, once other threads have terminated, Subscriber will not stop the JVM from
      // exiting.
      // If the Subscriber should simply run forever, either use the setExecutorProvider method in
      // Subscriber.Builder
      // to use non-daemon threads or run
      //   for (;;) {
      //     Thread.sleep(Long.MAX_VALUE);
      //   }
      // at the end of main() to previent the main thread from exiting.
      done.get();
      pool.shutdown();
      subscriber.stopAsync().awaitTerminated();
    }