### Question:
FunctionalUtils { public static <T> Consumer<T> toConsumer(UnsafeConsumer<T> unsafeConsumer, Logger logger) { return t -> { try { unsafeConsumer.accept(t); } catch (Exception e) { throw logger.throwing(new RuntimeException(e)); } }; } private  FunctionalUtils(); static boolean isEmpty(Collection<T> collection); static boolean isNotEmpty(Collection<T> collection); static boolean isEmpty(String string); static boolean isNotEmpty(String string); static Predicate<T> not(Predicate<T> predicate); static Consumer<T> toConsumer(UnsafeConsumer<T> unsafeConsumer, Logger logger); static BiConsumer<T, U> toBiConsumer(UnsafeBiConsumer<T, U> unsafeBiConsumer, Logger logger);  }### Answer:
@Test public void canUseConsumerThatThrowsCheckedExceptionInLambda() { Stream.of(false).forEach(toConsumer(this::consumerMethodWithChecked, logger)); }
@Test public void exceptionsForConsumersAreConverted() { thrown.expect(RuntimeException.class); thrown.expectMessage("Duh, something went wrong"); Stream.of(true).forEach(toConsumer(this::consumerMethodWithChecked, logger)); }