### Question:
Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } }  static T swallow(final Supplier<T> supplier, final T defaultReturn);  }### Answer:
@Test public void swallowRuntimeException() { final String result = Exceptions.swallow(() -> methodThatThrowsRuntimeException(), DEFAULT_RESULT); assertEquals(result, DEFAULT_RESULT); }
@Test public void swallowException() { final String result = Exceptions.swallow(() -> methodThatThrowsException(), DEFAULT_RESULT); assertEquals(result, DEFAULT_RESULT); }
@Test public void swallowNoException() { final String result = Exceptions.swallow(() -> methodNoException(), DEFAULT_RESULT); assertEquals(result, RESULT); }