GCDExecutorService extends AbstractExecutorService { public void shutdown() { SecurityManager sm = System.getSecurityManager(); if ( sm != null ) { sm.checkPermission(shutdownPerm); } try { shutdownLock.lock(); state = State.SHUTDOWN; terminateIfDone(queue.operationCount().intValue() == 0); } finally { shutdownLock.unlock(); } } GCDExecutorService(); void shutdown(); List<Runnable> shutdownNow(); boolean isShutdown(); boolean isTerminated(); boolean awaitTermination(long timeout, TimeUnit unit); void execute(Runnable command);  }
@Test(expected=RejectedExecutionException.class) public void testShutdown() { fixture.shutdown(); assertTrue(fixture.isShutdown()); assertTrue(fixture.isTerminated()); fixture.execute(new Runnable() { public void run() {} }); }