### Question:
InlineExecutorService extends AbstractExecutorService { @Override public void shutdown() { myShutdown = true; } InlineExecutorService(); @Override boolean awaitTermination(long timeout, TimeUnit unit); @Override final void execute(Runnable command); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdown(); @Override List<Runnable> shutdownNow();  }### Answer:
@Test public void testShutdown() { Runnable command = new Runnable() { @Override public void run() { } }; ExecutorService service = new InlineExecutorService(); service.execute(command); Assert.assertFalse(service.isShutdown()); service.shutdown(); Assert.assertTrue(service.isShutdown()); try { service.execute(command); Assert.fail("Command should not have been executed."); } catch (RejectedExecutionException e) { Assert.assertTrue(true); } }