private void initiateStop() {
    	stopLatch = new CountDownLatch(1);
        Thread stopThread = new Thread(() -> {
            if (server != null) {
                server.extinguish();
                initLatch = new CountDownLatch(1);
            }

            routes.clear();
            exceptionMapper.clear();
            staticFilesConfiguration.clear();
            initialized = false;
            stopLatch.countDown();
        });
        stopThread.start();
    }
Waits for the Spark server to stop.
<b>Warning:</b> this method should not be called from a request handler.
src/main/java/spark/Service.java