code: protected void join(@Nonnull final LifecycleStage lifecycleStage, final boolean cycle) throws InterruptedException
      {
          Runtime.getRuntime().addShutdownHook(new Thread() {
              @Override
              public void run()
              {
                  if (cycle) {
                      AbstractLifecycle.this.executeTo(lifecycleStage);
                  }
                  else {
                      AbstractLifecycle.this.execute(lifecycleStage);
                  }
              }
          });
          Thread.currentThread().join();
      }
docs: Register a shutdown hook to execute the given stage on JVM shutdown, and
  join against the current thread. This will block, so there needs to be a another way to shut
  the current thread down.
  
  @param lifecycleStage The stage to reach.
  @param cycle If true, then cycle to the stage, otherwise, just execute the stage.
  
  @throws InterruptedException if the Thread.currentThread.join() is interrupted