code: protected final void awaitShutdown() throws InterruptedException {
  		Runtime.getRuntime().addShutdownHook(new Thread(() -> {
  			try {
  				shutdown();
  				finishLatch.await();
  				Thread.sleep(10); // wait a bit for things outside `launch` call, such as JUnit finishing or whatever
  			} catch (InterruptedException e) {
  				logger.error("Shutdown took too long", e);
  			}
  		}, "shutdownNotification"));
  		shutdownLatch.await();
  	}
docs: Blocks current thread until shutdown notification releases it.
  <br>
  Shutdown notification is released on JVM shutdown or by calling {@link Launcher#shutdown()}