### Question:
SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor();  SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable);  }### Answer:
@Test void testWithoutExceptions() { SafeExecutor safeExecutor = new SafeExecutor(exceptionHandler); safeExecutor.execute(() -> { }); Mockito.verifyNoInteractions(exceptionHandler); }
@Test void testWithException() { SafeExecutor safeExecutor = new SafeExecutor(exceptionHandler); Exception e = new Exception(); safeExecutor.execute(() -> { throw e; }); Mockito.verify(exceptionHandler) .accept(e); }
@Test void testWithDefaultExceptionHandler() { SafeExecutor safeExecutor = new SafeExecutor(); Exception e = new Exception(); Assertions.assertDoesNotThrow(() -> safeExecutor.execute(() -> { throw e; })); }