Challenge 1: Anonymous Class vs. Lambda, Same Functional Interface — Possible Solution ==================================================================== StringTransformer.java: @FunctionalInterface public interface StringTransformer { String transform(String s); } TransformDemo.java: public class TransformDemo { public static void main(String[] args) { StringTransformer anonWay = new StringTransformer() { @Override public String transform(String s) { return s.toUpperCase(); } }; StringTransformer lambdaWay = s -> s.toUpperCase(); System.out.println(anonWay.transform("hello")); System.out.println(lambdaWay.transform("hello")); } } Output: HELLO HELLO Explanation: Both anonWay and lambdaWay implement the exact same single abstract method, transform(String), from the same functional interface. The lambda version is compact syntax for exactly what the anonymous inner class spells out in full -- an object supplying one method body. Both produce identical output because, under the hood, they're doing the same thing. WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates the chapter's own core claim directly -- a lambda and an anonymous inner class implementing the same functional interface produce identical results, since the lambda is genuinely sugar over the class-based form, not a separate mechanism.