Java 8 Lambdas: Why They Matter
Java 8 Lambdas: Why They Matter

Java 8 Lambdas: Why They Matter

Author
Shiv Bade
Tags
java8
lambdas
Published
June 3, 2015
Featured
Slug
Tweet
I finally embraced Java 8 lambdas this quarter — they made my unit tests cleaner and data transformations tighter.
Before:
Collections.sort(list, new Comparator<>() { public int compare(String a, String b) { return a.compareTo(b); } });
After:
list.sort((a, b) -> a.compareTo(b));
The difference is more than syntax — it's a mindset shift.