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).
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).
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.
Using Java Stream sorted operation on a stream will return a stream with the elements of the stream sorted according to their natural order.
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.
The Java stream toArray methods, which we learn in this post, allow us to collect/convert a stream into an array.
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.
This post shows 4 ways to throw checked exceptions in Java streams i.e., having a lambda expression that can throw checked exception(s).
Java Streams has a distinct method which removes duplicates by object’s equal method. This post explains ways to apply distinct by a property.
The Java Stream Distinct is a stateful intermediate operation which returns a new stream which has only the distinct elements in it.
This post is on the anyMatch, allMatch and noneMatch methods which are short-circuiting terminal operations on a Java Stream.