docs: public void addShutdownHook() {
          shutdownHookThread = new Thread(new Runnable() {
              @Override
              public void run() {
                  beforeShutdown();
              }
          });
          Runtime.getRuntime().addShutdownHook(shutdownHookThread);
      }