@Test public void propagatesRejectionThroughExecute() { doThrow(REJECTED_EXECUTION_EXCEPTION).when(delegate).execute(any()); assertThatThrownBy(() -> checkedRejectionExecutor.execute(DO_NOTHING)) .isInstanceOf(CheckedRejectedExecutionException.class) .hasCause(REJECTED_EXECUTION_EXCEPTION); }
public void execute(Runnable runnable) throws CheckedRejectedExecutionException { try { underlying.execute(runnable); } catch (RejectedExecutionException ex) { throw new CheckedRejectedExecutionException(ex); } }
CheckedRejectionExecutorService { public void execute(Runnable runnable) throws CheckedRejectedExecutionException { try { underlying.execute(runnable); } catch (RejectedExecutionException ex) { throw new CheckedRejectedExecutionException(ex); } } }
CheckedRejectionExecutorService { public void execute(Runnable runnable) throws CheckedRejectedExecutionException { try { underlying.execute(runnable); } catch (RejectedExecutionException ex) { throw new CheckedRejectedExecutionException(ex); } } CheckedRejectionExecutorService(ExecutorService underlying); }
CheckedRejectionExecutorService { public void execute(Runnable runnable) throws CheckedRejectedExecutionException { try { underlying.execute(runnable); } catch (RejectedExecutionException ex) { throw new CheckedRejectedExecutionException(ex); } } CheckedRejectionExecutorService(ExecutorService underlying); void execute(Runnable runnable); Future<T> submit(Callable<T> callable); }
CheckedRejectionExecutorService { public void execute(Runnable runnable) throws CheckedRejectedExecutionException { try { underlying.execute(runnable); } catch (RejectedExecutionException ex) { throw new CheckedRejectedExecutionException(ex); } } CheckedRejectionExecutorService(ExecutorService underlying); void execute(Runnable runnable); Future<T> submit(Callable<T> callable);  }