He paused. map returns an empty Optional if the function returns null . ifPresent does nothing. Output? Nothing. Correct.
list.forEach(System.out::println);
If you have to take this test tomorrow, don't panic. Do this: ikm java 8 test updated
The most significant shift in the updated IKM Java 8 test is its heavy emphasis on . Java 8’s introduction of lambda expressions, method references, and functional interfaces (like Predicate , Function , and Consumer ) fundamentally changed how developers write Java code. The IKM test does not merely ask candidates to identify a lambda syntax; it presents complex scenarios involving variable capture, effectively final variables, and the behavioral differences between anonymous inner classes and lambdas. Furthermore, the test probes the java.util.function package in depth, requiring the test-taker to understand when to use BiFunction over BinaryOperator or why IntSupplier differs from Supplier<Integer> . A candidate who learned Java 8 superficially by "replacing anonymous classes with ->" will find these questions particularly challenging. He paused
The updated test has . That’s 90 seconds per question. Multi-select questions will take longer. Strategy: Output