Study repository focused on exploring Java Streams, showcasing a wide range of intermediate and terminal operations using clear, commented examples for learning purposes.
- Creating streams from collections, arrays, sets, and maps;
- Filter, map, distinct, sorted, limit, and forEach operations with Lambdas;
- Counting and validating elements with
count()andallMatch(); - Collecting stream results into lists, sets, maps, and grouping with
Collectors; - Working with
Optionalto find max/min (e.g., oldest and youngest); - Filtering by gender using console input and stream logic.
br.com.eaugusto: Contains the sharedPerson.javaclass used by most examples, and theCreatingStreams.javaclass for stream creation;br.com.eaugusto.intermediateoperations: Filter, Map, Limit, Distinct, Sorted, etc;br.com.eaugusto.terminaloperations: forEach, count, allMatch and collectors;br.com.eaugusto.coursetask: Exercise involving filtering by gender using input, has its ownPerson.javaclass;
- Clone this repository and open it in your IDE (Spring Tool Suite, Eclipse, IntelliJ);
- Each class has a
mainmethod with examples that can be run directly; - Review the inline comments and Javadocs for detailed explanations of each operation.
- Created filtering by gender using
FilterByGenderand the new localPersonclass specific to the newcoursetaskpackage.
- Added optional examples for finding youngest and oldest entries;
- Renamed
CollectExampletoCollectExamplesand added Javadocs.
- Implemented various
Collectors: toList, toSet, toMap, groupingBy, etc.; - Expanded
Personand added grouping examples.
- Created classes for:
filter,map,limit,distinct,sorted, andforEachexamples; - Built helper methods to populate people and reuse logic.
- Understand how Java Stream API simplifies collection processing;
- Practice real-world stream operations with filtering, mapping and aggregation;
- Apply functional programming concepts like lambdas and method references;
- Explore
Optionalhandling for safer data retrieval.