### Question:
Exercise6 { static <A, B> Consumer1<A> composeConsumer(final Function1<A, B> function, final Consumer1<B> consumer) { return (A a) -> consumer.accept(function.apply(a)); }    }### Answer:
@Test public void should_compose_function_with_consumer() { final Consumer1<Integer> consumer = integer -> System.out.println(String.format("consumed: %d", integer)); final Function1<String, Integer> function = Integer::valueOf; final Consumer1<String> tested = Exercise6.composeConsumer(function, consumer); tested.accept("42"); }