@@ -0,0 +1,1924 @@
+import java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.function.Consumer;%0A%0Aclass HelloLambdasConsumer %7B%0A%09public static void main(String... args) %7B%0A%09%09System.out.println(%22Hello Lambdas Consumer!%22);%0A%09%09List%3CString%3E strings = Arrays.asList(%22Moe%22, %22Larry%22, %22Curly%22);%0A%0A%09%09// Simplest Consumer Lambda - Inlined%0A%09%09System.out.println(%22---%22);%0A%09%09strings.forEach(x -%3E System.out.println(x));%0A%0A%09%09System.out.println(%22---%22);%0A%09%09strings.forEach(x -%3E System.out.println(x.toLowerCase()));%0A%0A%09%09// Inlined with parentheses%0A%09%09System.out.println(%22---%22);%0A%09%09strings.forEach((x) -%3E System.out.println(x.toLowerCase()));%0A%0A%09%09// Inlined with explicit data type%0A%09%09System.out.println(%22---%22);%0A%09%09strings.forEach((String x) -%3E System.out.println(x.toLowerCase()));%0A%0A%09%09// Inlined as a Block Statement%0A%09%09System.out.println(%22---%22);%0A%09%09strings.forEach(x -%3E %7B%0A%09%09%09StringBuilder sb = new StringBuilder(x);%0A%09%09%09System.out.println(sb.reverse());%0A%09%09%7D);%0A%0A%09%09// Consumer Lambda as an Object%0A%09%09Consumer%3CString%3E printUpper = x -%3E System.out.println(x.toUpperCase());%0A%09%09System.out.println(%22---%22);%0A%09%09printUpper.accept(%22Hello World!%22);%0A%0A%09%09// Consumer Lambda Object as a Block Statement%0A%09%09Consumer%3CString%3E printReversed = x -%3E %7B%0A%09%09%09StringBuilder sb = new StringBuilder(x);%0A%09%09%09System.out.println(sb.reverse());%0A%09%09%7D;%0A%09%09System.out.println(%22---%22);%0A%09%09printReversed.accept(%22Hello World!%22);%0A%0A%09%09// Consumer Lambda Object Method Reference Inlined%0A%09%09Consumer%3CString%3E printLower = x -%3E System.out.println(x.toLowerCase());%0A%09%09System.out.println(%22---%22);%0A%09%09strings.forEach(printLower::accept);%0A%0A%09%09// Consumer Lambda Object As a Parameter to a Separate Method%0A%09%09System.out.println(%22---%22);%0A%09%09printStrings(strings, printUpper);%0A%0A%09%09// Consumer Lambda Object In a Stream%0A%09%09System.out.println(%22---%22);%0A%09%09strings.stream().forEach(printReversed);%0A%09%7D%0A%0A%09private static final void printStrings(final List%3CString%3E strings, final Consumer%3CString%3E printer) %7B%0A%09%09strings.forEach(printer::accept);%0A%09%7D%0A%7D%0A

Create HelloLambdasConsumer.java