WorkflowInstanceExecutor { public void shutdown() { executor.shutdown(); try { if (!executor.awaitTermination(awaitTerminationSeconds, SECONDS)) { logger.warn("Timed out while waiting for executor to terminate"); } } catch (@SuppressWarnings("unused") InterruptedException ex) { logger.warn("Interrupted while waiting for executor to terminate"); currentThread().interrupt(); } } WorkflowInstanceExecutor(int maxQueueSize, int threadCount, int notifyThreshold, int awaitTerminationSeconds,
      int keepAliveSeconds,
      ThreadFactory threadFactory); int getThreadCount(); void waitUntilQueueSizeLowerThanThreshold(DateTime waitUntil); void wakeUpDispatcherIfNeeded(); void execute(Runnable runnable); int getQueueRemainingCapacity(); void shutdown();  }
@Test public void testShutdown() { WorkflowInstanceExecutor t = new WorkflowInstanceExecutor(3, 2, 1, 3, 4, new CustomizableThreadFactory("test")); t.shutdown(); assertThat(t.executor.isShutdown(), is(true)); }