This index makes it easier to discover the learning material and practice exercises included in this repository.
- Core concepts:
src/test/java/com/github/streams/learn/concepts - Intermediate operations:
src/test/java/com/github/streams/learn/intermediate_operations - Terminal operations:
src/test/java/com/github/streams/learn/terminal_operations - Practice hub:
src/test/java/com/github/streams/practice
Available concept notes include topics such as:
- What is a stream?
- How to create a stream
- Primitive streams
- Stream vs collection
- Intermediate vs terminal operations
- Lazy evaluation
- Single-use streams
- Optional results
- When not to use the Streams API
Open the folder: learn/concepts
This repository includes notes for these Java Stream API intermediate operations:
filtermapflatMapdistinctsortedpeeklimitskiptakeWhiledropWhilemapMulti
Open the folder: learn/intermediate_operations
This repository includes notes for these Java Stream API terminal operations:
countforEachforEachOrderedtoArrayminmaxanyMatchallMatchnoneMatchfindFirstfindAnyreducecollect
Open the folder: learn/terminal_operations
- Numbers: count even numbers, map Celsius to Fahrenheit, remove duplicates, sort ascending or descending, calculate mean, flatten 2D arrays, and group numbers
- Strings: count vowels, find the largest word, count character and word occurrences, concatenate strings, reverse strings with special characters, sort by the second character, find duplicate strings, and more
Open the folder: practice/a_easy_problems
- Employee stream problems: minimum salary in each department, maximum salary in each department, employee counts, employees by department, managers with maximum employees, and employees who worked on the most projects
- Number problems: sum of numbers, sum of unique numbers, sum of digits, reverse a number, segregate even and odd numbers, generate an infinite prime number stream, and more
- String problems: duplicates, second highest word, first non-repeating character, unique email count, and frequent vowel-plus-consonant patterns
Open the folder: practice/b_medium_problems
- Generate a prime number stream
- Find the length of the largest consecutive sequence
Open the folder: practice/c_hard_problems
Practice tests are available for:
PredicateFunctionConsumerSupplierBiFunctionComparatorRunnable
Open the folder: practice/functional_interfaces
The repository also includes material for Java Stream gatherers:
- Learn gatherer concepts in
learn/gatherers - Practice gatherers in
practice/gatherers
- Read the core concepts
- Study intermediate operations
- Study terminal operations
- Solve easy practice problems
- Solve medium practice problems
- Solve hard practice problems
- Review functional interfaces
- Explore gatherers on a supported JDK