### Question:
ExecutorUtils { public static void shutdownNowAndAwait(ExecutorService executor) { if (!executor.isTerminated()) { if (!executor.isShutdown()) { executor.shutdownNow(); } await(executor); } } private  ExecutorUtils(); static int getParallelism(); static void shutdownNowAndAwait(ExecutorService executor); static void shutdownAndAwait(ExecutorService executor); static void checkExceptions(Iterable<Future<T>> futures);  }### Answer:
@Test public void testNow() { final AtomicInteger count = new AtomicInteger(); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit(new Callable<Object>() { @Override public Void call() throws InterruptedException { Thread.sleep(500L); count.incrementAndGet(); return null; } }); ExecutorUtils.shutdownNowAndAwait(executor); assertEquals(0, count.get()); }