Lambda Chops: Recipes for Simpler, More Expressive Code
summary
Shows concrete recipes: use Optional.map null-safe chains instead of nested null checks; implement a supplier-based firstNonNull so candidates run lazily or in parallel; write small factory methods that build a FileVisitor from one-argument lambdas and use an unchecked wrapper for checked exceptions to keep lambdas concise; prefer java.util.function types, use Comparator.comparing and JUnit 5 dynamic tests for compile-time safety, and replace double-checked locking with a library Lazy for correct, simple lazy init.
AI-written summary · about
chapters (11)
- 0:00Intro
- 5:06Lambda trick: Null-Safe Navigation
- 8:16Lambda trick: first non-null object
- 12:14Lambda Trick: Multi-method interfaces
- 17:41Exception Transparency via Generics
- 19:09"Uncheck" Exceptions
- 21:38Resource management In Java 7
- 28:17Make a comparator
- 30:36JUnit 5 Parameterized Tests
- 32:41JUnit 5 Type-safe Parameterized Tests
- 36:39Best practices
related talks
47mBeyond lambdas, the aftermath
56mJava Functional Programming Idioms
49mJava Functional Programming Idioms
01h 02mFunctional Programming in Java, Groovy, and Kotlin
01h 05mJava 8: The Good, the Bad and the Ugly
57mTen Common mistakes made in Functional Java
49mJava 8: the good, the bad and the ugly
55mFunctional Programming in Java
