code: public void close() {
          if (server == null) {
              throw new IllegalStateException("server has not been started.");
          }
          try {
              server.stop();
          } catch (Exception e) {
              throw new IllegalStateException("Failed to stop the Tomcat.", e);
          }
      }
docs: =====