top of page

Java 8 stream hidden features

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Apr 25, 2024
  • 1 min read

we can make use of

Stream.ofNullable - return the same result as above


2.stream.iterate()- create infinite stream, creating certain pattern like 0,2,4,6,8.......

This create infinite stream



To break this infinite stream, we need to add termination, so we make use of limit as below


Collectors.collectingAndThen

to perform addtional transformation on collectors.

for ex: avg salary of employee


stream.takeWhile, stream.dropWhile




Collectors.teeing()

allows you to collect 2 collectors parallel and combine the result.



Collectors.partioningBy

allows you to partition a stream by certain condition


 
 
 

Recent Posts

See All
Best Chunking Practices

1. Chunk by Semantic Boundaries (NOT fixed size only) Split by sections, headings, paragraphs , or logical units. Avoid cutting a sentence or concept in half. Works best with docs, tech specs, policie

 
 
 
Future State Architecture

USE CASE: LARGE RETAIL BANK – DIGITAL CHANNEL MODERNIZATION 🔹 Business Context A large retail bank wants to “modernize” its digital channels (internet banking + mobile apps). Constraints: Heavy regul

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page