Immutable Collections in Google Guava
Google Guava provides ways to create Immutable Collections. In this post, we will learn to create immutable collections using Google Guava.
Google Guava provides ways to create Immutable Collections. In this post, we will learn to create immutable collections using Google Guava.
An EnumMap in Java is a specialized map implementation for use with enum type as the keys. In this post, we will learn EnumMaps in Java.
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.
The Java 8 LongStream is a sequence of primitive long-valued elements and is a long primitive specialization of Stream.
Collectors.joining returns a Collector which concatenates the stream elements separated by a delimiter, prefix and suffix in encounter order.
Java 8 StringJoiner class can be used to build a sequence of characters that are separated by a configured delimiter, prefix and a suffix.
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.
The Java 8 Streams has findFirst and findAny methods which will return the first element and an arbitrary element from a stream respectively.