@Test public void awaitTerminationWithoutShutdown() throws InterruptedException { ExecutorService executorService = new CurrentThreadExecutorService(); expected.expect(IllegalStateException.class); executorService.awaitTermination(1, TimeUnit.SECONDS); }
@Override public boolean awaitTermination(long timeout, TimeUnit unit) { if (!isShutdown) { throw new IllegalStateException("awaitTermination() should be called after the shutdown"); } return true; }
CurrentThreadExecutorService extends AbstractExecutorService { @Override public boolean awaitTermination(long timeout, TimeUnit unit) { if (!isShutdown) { throw new IllegalStateException("awaitTermination() should be called after the shutdown"); } return true; } }
CurrentThreadExecutorService extends AbstractExecutorService { @Override public boolean awaitTermination(long timeout, TimeUnit unit) { if (!isShutdown) { throw new IllegalStateException("awaitTermination() should be called after the shutdown"); } return true; }  }
CurrentThreadExecutorService extends AbstractExecutorService { @Override public boolean awaitTermination(long timeout, TimeUnit unit) { if (!isShutdown) { throw new IllegalStateException("awaitTermination() should be called after the shutdown"); } return true; }  @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override boolean awaitTermination(long timeout, TimeUnit unit); @Override void execute(Runnable command); }
CurrentThreadExecutorService extends AbstractExecutorService { @Override public boolean awaitTermination(long timeout, TimeUnit unit) { if (!isShutdown) { throw new IllegalStateException("awaitTermination() should be called after the shutdown"); } return true; }  @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override boolean awaitTermination(long timeout, TimeUnit unit); @Override void execute(Runnable command);  }