SingleThreadContext extends AbstractThreadContext { @Override public void execute(final Runnable command) { wrappedExecutor.execute(new WrappedRunnable(command)); } SingleThreadContext(final String nameFormat);  SingleThreadContext(
      final String nameFormat, final Consumer<Throwable> uncaughtExceptionObserver);  SingleThreadContext(final ThreadFactory factory);  SingleThreadContext(
      final ThreadFactory factory, final Consumer<Throwable> uncaughtExceptionObserver); protected  SingleThreadContext(
      final ScheduledExecutorService executor,
      final Consumer<Throwable> uncaughtExceptionObserver); private  SingleThreadContext(
      final Thread thread,
      final ScheduledExecutorService executor,
      final Consumer<Throwable> uncaughtExceptionObserver); @Override void execute(final Runnable command); @Override Scheduled schedule(final Duration delay, final Runnable runnable); @Override Scheduled schedule(
      final Duration delay, final Duration interval, final Runnable runnable); @Override void close();  }
@Test public void shouldInvokeHandlerOnException() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); exceptionHandler = e -> latch.countDown(); threadContext.execute( () -> { throw new RuntimeException(); }); latch.await(2, TimeUnit.SECONDS); assertEquals(0, latch.getCount()); }