@Test public void loggedMuteShouldLogExceptionTraceBeforeSwallowingIt() throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); System.setErr(new PrintStream(stream)); Mute.loggedMute(() -> methodThrowingException()); assertTrue(new String(stream.toByteArray()).contains(MESSAGE)); }
public static void loggedMute(CheckedRunnable runnable) { try { runnable.run(); } catch (Exception e) { e.printStackTrace(); } }
Mute { public static void loggedMute(CheckedRunnable runnable) { try { runnable.run(); } catch (Exception e) { e.printStackTrace(); } } }
Mute { public static void loggedMute(CheckedRunnable runnable) { try { runnable.run(); } catch (Exception e) { e.printStackTrace(); } } private  Mute(); }
Mute { public static void loggedMute(CheckedRunnable runnable) { try { runnable.run(); } catch (Exception e) { e.printStackTrace(); } } private  Mute(); static void mute(CheckedRunnable runnable); static void loggedMute(CheckedRunnable runnable); }
Mute { public static void loggedMute(CheckedRunnable runnable) { try { runnable.run(); } catch (Exception e) { e.printStackTrace(); } } private  Mute(); static void mute(CheckedRunnable runnable); static void loggedMute(CheckedRunnable runnable);  }