code: private void stop() {
          complete();
  
          Citrus citrus = Citrus.CitrusInstanceManager.getSingleton();
          if (citrus != null) {
              log.info("Closing Citrus and its application context");
              citrus.close();
          }
      }
docs: Stop application by setting completed state and stop application context.