- 🧠 4.1: Using Variables in Lambdas
- 🧠 4.2: Working with Built-in Functional Interfaces
- 🧠 4.3: Returning an Optional
- 🧠 4.4: Using streams
- 🧠 4.5: Working with Primitives
- 🧠 4.6: Working with Advanced Pipeline Concepts
- 🧠 4.7 Summary
- 📝 Revision Notes
- ✅ Review Questions
This chapter will introduce more functional interfaces and the Optional
class.
-
Generics and Collections:
- Collections Steams and Filters
- Iterate using forEach methods on Streams and List
- Describe Stream interface and Stream pipeline
- Use method references with Streams
-
Lambda Built-In Functional Interfaces
- Use the built-in interfaces in
java.util.function
such asPredicate
,Consumer
,Function
andSupplier
- Develop code which uses primitive versions of functional interfaces
- Develop code which uses binary version of functional interfaces.
- Develop code that uses the
UnaryOperator
interface
- Use the built-in interfaces in
-
Java Stream API:
- Develop code to extract data from an object using
peek()
andmap()
methods including the primitive versions ofmap()
- Search for data by using search methods in Streams such as
findFirst
,findAny
,anyMatch
,allMatch
, andnoneMatch
- Develop code which uses the
Optional
class - Develop code which uses Stream data and calculation methods
- Sort a collection using Stream API
- Save results to a collection using the collect method
- Use
merge()
andflat()
methods of Stream API
- Develop code to extract data from an object using