SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JAVA 17 / NOTES</>↗
Java 1728 Oct 2025

How do I use Collectors.partitioningBy?

The Collectors.partitioningBy is a method in Java’s java.util.stream.Collectors class that is used to partition elements of a stream into two groups based on a predicate. It essentially creates a Map with a boolean key (true or false) and lists of elements as values. Here’s an explanation of how to use it effectively: Syntax: Collectors.partitioningBy(Predicate<? super […]

Wayan · 3 min read
JAVA 11 / NOTES</>↗
Java 1128 Oct 2025

How do I collect stream results into an immutable collection?

In Java, you can use the Stream API’s Collectors to gather stream results into an immutable collection. Since Java 10, you can use Collectors.toUnmodifiableList(), Collectors.toUnmodifiableSet(), and other similar methods to collect the results into unmodifiable collections. Here’s how you can collect the stream results into an immutable collection: 1. Immutable List To collect the results […]

Wayan · 3 min read
BASIC / NOTES</>↗
Basic27 Oct 2025

How do I use Map.merge() to simplify counting logic?

The Map.merge method in Java is a convenient way to simplify various kinds of logic that require updating or modifying values in a map, such as counting occurrences. It works by letting you specify how to combine the old value (if it exists) and the new value (to be added). This is particularly useful for […]

Wayan · 3 min read
UTIL PACKAGE / NOTES</>↗
Util Package26 Oct 2025

How do I use ConcurrentHashMap.computeIfAbsent safely?

To safely use ConcurrentHashMap.computeIfAbsent, it’s important to understand both its purpose and how to use it in a thread-safe manner. Purpose of computeIfAbsent computeIfAbsent is a method of ConcurrentHashMap that: Checks if the key exists in the map. If the key exists, it returns the associated value. If the key does not exist, it computes […]

Wayan · 3 min read
JAVA 16 / NOTES</>↗
Java 1626 Oct 2025

How do I use LinkedHashMap for predictable iteration order?

In Java, a LinkedHashMap is a subtype of HashMap that maintains a predictable iteration order. It uses a doubly linked list to store the entries in insertion order (or, optionally, access order). Here’s how you can use LinkedHashMap for predictable iteration order: 1. Maintaining Insertion Order By default, a LinkedHashMap iterates its entries in the […]

Wayan · 4 min read
SOUND API / NOTES</>↗
Sound API25 Oct 2025

How do I use Collectors.groupingBy() with downstream collectors?

The Collectors.groupingBy is a powerful method in Java’s Stream API that allows grouping of elements in a stream based on a classification function, and it works well with downstream collectors. Here’s how you can use Collectors.groupingBy with downstream collectors effectively. Syntax of Collectors.groupingBy with a Downstream Collector The key method signature is: Collectors.groupingBy(Classifier, Downstream) Classifier: […]

Wayan · 4 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.