### Question:
DelayedShutdown extends Thread { public final void start(boolean runInBackground) { if (runInBackground) { start(); return; } run(); } DelayedShutdown(Runnable onStart); DelayedShutdown onError(Consumer<Exception> onError); DelayedShutdown afterDelay(Runnable afterDelay); DelayedShutdown onDecrement(Consumer<Long> onDecrement); DelayedShutdown delay(long delayInMillis); DelayedShutdown decrementInMillis(int decrementInMillis); @Override final void run(); final void start(boolean runInBackground); static final int DEFAULT_DECREMENT_IN_MILLIS; }### Answer:
@Test public void exceptionsAreNotRethrown() { String expectedMessage = UUID.randomUUID().toString(); DelayedShutdown shutdown = new DelayedShutdown(() -> {throw new NullPointerException(expectedMessage);}); shutdown.start(false); }