September 2019
Intermediate to advanced
816 pages
18h 47m
English
There are at least three solutions when it comes to debugging lambdas:
Let's focus on the first two since relying on an IDE is a very large and specific topic that isn't in the scope of this book.
Inspecting the stack trace of a failure that happened inside a lambda or a stream pipeline can be pretty puzzling. Let's consider the following snippet of code:
List<String> names = Arrays.asList("anna", "bob", null, "mary");names.stream() .map(s -> s.toUpperCase()) .collect(Collectors.toList());
Since the third element from this list is null, we will get ...