Free Your Lambdas
summary
Walks through converting anonymous Comparator and Runnable code into Java 8 lambdas, using java.util.function types (Consumer, Supplier, Function, Predicate), default methods to add composition like and/then/negate, and method references and static factory methods to build comparators and factories. Builds a comparator factory with key extractors, shows generic compare and reversed, and refactors a registry/builder into a lambda-backed factory that hides its map (avoids reflection/concurrency bugs). Demos compile and run and add fail‑fast null checks so bugs surface at lambda creation.
AI-written summary · about
chapters (29)
- 0:00Intro
- 0:52Overview
- 1:59Who am I
- 2:31Apology
- 2:49Questions
- 3:09Easy Quiz
- 8:55Comparator
- 9:40Passing code as a parameter
- 10:15Writing a lambda
- 11:06Functional interfaces
- 12:25Demo time
- 15:47Iterable interface
- 16:10Abstract method
- 16:41Iterable
- 18:07Execution
- 19:06Runnable
- 19:43Random
- 20:51Compiler Error
- 22:01Writing Lambdas
- 22:36Method Reference
- 23:53Default Method
- 25:36Abstract Methods
- 25:54Consumer Interface
- 39:15Fail Fast Fail
- 41:29Default Methods
- 43:50Functional Interface
- 45:49Comparators
- 53:44Then Compare
- 57:24Compare
related talks
47mBeyond lambdas, the aftermath
53mLambdas in Java: A Peek Under the Hood
01h 06mProject Lambda: Simplifying Concurrent Programming in Java SE 8
41mThe... wonderful? World of lambdas
55mFunctional Programming in Java
01h 01mAPI Design with Java 8 Lambdas and Streams
46mAchieving Functional Programming in Java
55mTransforming Your Code to Java 8
