Use the following problems to test your functional style programming prowess. I strongly encourage you to give each problem a try before you turn to the solutions and download the example programs:
- Testing high-order functions: Write several unit tests for testing so-called high-order functions.
- Testing methods that use lambdas: Write several unit tests for testing methods that use lambdas.
- Debugging lambdas: Provide a technique for debugging lambdas.
- Filtering the non-zero elements of a stream: Write a stream pipeline that filters the non-zero elements of a stream.
- Infinite streams, takeWhile(), and dropWhile(): Write several snippets of code that work with infinite streams. In addition, write several examples of working with the takeWhile() and dropWhile() APIs.
- Mapping a stream: Write several examples of mapping a stream via map() and flatMap().
- Finding different...