Java Stream map operation

We use the Java Stream map (an intermediate operation) to map an element in a stream to a different value (of the same or different type).

October 30, 2023

Java Stream min and max

In this post, we will learn about using Java Stream min and max methods to find the minimum and the maximum element in a Java Stream.

September 25, 2023

Java Stream sorted operation

Using Java Stream sorted operation on a stream will return a stream with the elements of the stream sorted according to their natural order.

August 28, 2023

Java Stream Reduce

We use the Java Stream’s reduce method to reduce a stream of values to a single result. There are three overloaded Stream#reduce operation.

January 2, 2023

Java Stream toArray

The Java stream toArray methods, which we learn in this post, allow us to collect/convert a stream into an array.

March 15, 2022

Six Ways to Convert a Java Stream to a List

In this post, we will see six ways to convert a Java stream to a List. You can extend these if you want to convert a stream to a Set as well.

December 14, 2020

4 Ways to throw Checked Exceptions in Java Streams

This post shows 4 ways to throw checked exceptions in Java streams i.e., having a lambda expression that can throw checked exception(s).

November 17, 2020

Java Stream Distinct by Property

Java Streams has a distinct method which removes duplicates by object’s equal method. This post explains ways to apply distinct by a property.

November 9, 2020

Java Stream Distinct with Examples

The Java Stream Distinct is a stateful intermediate operation which returns a new stream which has only the distinct elements in it.

November 2, 2020

Java 8 Streams – anyMatch, allMatch, and noneMatch

This post is on the anyMatch, allMatch and noneMatch methods which are short-circuiting terminal operations on a Java Stream.

October 5, 2020