Slide 29
Slide 29 text
@GopalAkshintala
Impure Pure
static void add(int a, int b,
Consumer consumer) {
consumer.accept(a + b);
}
/ /
Function call in Prod
add(1, 2, System.out
::
println);
/ /
Function call in Test
add(1, 2, result
->
assertEquals(3, result));