Chapter 8. Refactoring, testing, and debugging

This chapter covers

  • How to refactor code to use lambda expressions
  • The impact of lambda expressions on object-oriented design patterns
  • Testing lambda expressions
  • Debugging code that uses lambda expressions and the Streams API

In the first seven chapters of this book, you saw the expressive power of lambdas and the Streams API. You were mainly creating new code that made use of these features. This is great if you have to start a new Java project—you can use lambdas and streams immediately.

Unfortunately, you don’t always get to start a new project from scratch. Most of the time you’ll have to deal with an existing codebase written in an older version of Java.

This is the purpose of this ...

Get Java 8 in Action: Lambdas, streams, and functional-style programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.