private void waitForTerminated() throws InterruptedException {
        long lastTime = System.currentTimeMillis();
        while (!executorService.isTerminated()) {
            defaultShortSleep();

            if (LOGGER.isDebugEnabled()) {
                long time = System.currentTimeMillis();

                if (time - lastTime > LOGGING_DEBUG_MS) {
                    LOGGER.debug("waitForComplete() - " + toString());
                }
                lastTime = time;
            }
        }
    }
Wait for the thread pool to stop.
stroom-util/src/main/java/stroom/util/concurrent/SimpleExecutor.java