@Test void testWithoutExceptions() { SafeExecutor safeExecutor = new SafeExecutor(exceptionHandler); safeExecutor.execute(() -> { }); Mockito.verifyNoInteractions(exceptionHandler); }
public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } }
SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } }
SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor();  SafeExecutor(Consumer<Exception> exceptionHandler); }
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); }
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);  }