Tagged articles
20 articles
Page 1 of 1
Java Backend Technology
Java Backend Technology
Aug 13, 2025 · Backend Development

Why Stream.toList() Throws UnsupportedOperationException vs collect(Collectors.toList())

This article explains the key differences between Java's Stream toList() method introduced in JDK 16, which returns an unmodifiable list, and the traditional collect(Collectors.toList()) which yields a mutable ArrayList, illustrating behavior with code examples, performance considerations, and practical usage tips.

CollectionsCollectorsImmutable List
0 likes · 8 min read
Why Stream.toList() Throws UnsupportedOperationException vs collect(Collectors.toList())
macrozheng
macrozheng
Jun 30, 2025 · Backend Development

Mastering Java Stream toMap: Handling Duplicate Keys with Ease

Learn how to effectively use Java's Stream API to convert a list of User objects into a Map, handle duplicate keys by providing a merge function, and avoid common pitfalls like IllegalStateException and NullPointerException using Optional and concise code examples.

CollectorsDuplicate KeyJava
0 likes · 6 min read
Mastering Java Stream toMap: Handling Duplicate Keys with Ease
macrozheng
macrozheng
Jul 11, 2024 · Backend Development

Mastering Java Stream toMap: Handling Duplicate Keys and Null Values

This article explains how to convert a list of Java objects into a Map using Stream's toMap collector, addresses duplicate key exceptions, demonstrates providing a merge function, handling null values with Optional, and compares alternative approaches such as manual loops, offering complete code examples.

CollectorsDuplicate KeyStream
0 likes · 7 min read
Mastering Java Stream toMap: Handling Duplicate Keys and Null Values
Architecture Digest
Architecture Digest
Jan 25, 2024 · Backend Development

Understanding Java 8 Functional Interfaces and Stream Operations

This article explains Java 8's lambda expressions, functional interfaces, and the Stream API, demonstrating how immutable values and functions enable concise data processing through lazy and eager evaluation, with practical code examples covering predicates, consumers, mapping, filtering, grouping, and reduction.

CollectorsFunctional InterfacesJava
0 likes · 12 min read
Understanding Java 8 Functional Interfaces and Stream Operations
Programmer DD
Programmer DD
Mar 14, 2023 · Backend Development

Stream.toList vs Collectors.toList: Which Java List Conversion Is Faster?

This article compares Java's Stream.toList(), Collectors.toList(), and Collectors.toUnmodifiableList() by explaining their differences, showing benchmark code, presenting performance results for both 1,000 and 10,000 element streams, and concluding which method offers superior speed and efficiency.

BenchmarkCollectorsStream
0 likes · 8 min read
Stream.toList vs Collectors.toList: Which Java List Conversion Is Faster?
Architect's Tech Stack
Architect's Tech Stack
Oct 12, 2022 · Fundamentals

Java 8 Functional Interfaces and Stream Operations: Concepts, Examples, and Advanced Collectors

This article introduces Java 8's functional interfaces and lambda expressions, explains immutable values and function composition, demonstrates common stream operations such as collect, filter, map, flatMap, max/min, count, and reduce, and shows how to use advanced collectors like groupingBy, partitioningBy, and joining with practical code examples.

CollectorsFunctional InterfaceJava
0 likes · 17 min read
Java 8 Functional Interfaces and Stream Operations: Concepts, Examples, and Advanced Collectors
FunTester
FunTester
Nov 24, 2021 · Backend Development

Mastering Java Stream Collectors: Practical Examples and Code Walkthrough

This article provides a hands‑on guide to Java 8 Stream Collectors, demonstrating how to use toList, toSet, toCollection, toMap, summingInt, joining, groupingBy, partitioningBy and related collectors with clear code examples and output results.

BackendCollectorsDataAggregation
0 likes · 11 min read
Mastering Java Stream Collectors: Practical Examples and Code Walkthrough
Top Architect
Top Architect
Aug 5, 2021 · Backend Development

Using Java 8 Streams and Functional Interfaces: A Comprehensive Guide

This article explains Java 8's lambda expressions and functional interfaces, demonstrates common Stream operations such as filter, map, flatMap, collect, max/min, count and reduce, and shows how to use advanced collectors for grouping, partitioning and joining with clear code examples.

CollectorsFunctional InterfacesJava
0 likes · 12 min read
Using Java 8 Streams and Functional Interfaces: A Comprehensive Guide
FunTester
FunTester
Jul 20, 2021 · Backend Development

How to Sort a Java Map by Value Using LinkedHashMap and Lambdas

This article explains why HashMap cannot preserve entry order, introduces LinkedHashMap to maintain insertion order, and provides both classic and lambda‑based Java solutions—including detailed code snippets—to sort a Map by its values efficiently.

CollectorsJavaLambda
0 likes · 8 min read
How to Sort a Java Map by Value Using LinkedHashMap and Lambdas
Architect's Tech Stack
Architect's Tech Stack
Apr 28, 2021 · Backend Development

Java 8 Lambda Expressions, Functional Interfaces, and Stream API Tutorial

This article introduces Java 8's lambda expressions and functional interfaces, demonstrates custom functional interfaces, and explains how to use the Stream API with operations such as collect, filter, map, flatMap, max/min, count, reduce, partitioningBy, groupingBy, and joining, providing code examples throughout.

CollectorsFunctional InterfacesJava
0 likes · 13 min read
Java 8 Lambda Expressions, Functional Interfaces, and Stream API Tutorial
Architect's Tech Stack
Architect's Tech Stack
Mar 29, 2021 · Backend Development

Using IntelliJ IDEA Live Templates to Simplify Java Stream Collectors

This article explains how to upgrade Java code to use lambda expressions and the Stream API, highlights the inconvenience of repeatedly writing collect(Collectors.toList()) calls, and shows how IntelliJ IDEA's Live Templates can automate common collector patterns to boost productivity.

Backend DevelopmentCollectorsIntelliJ IDEA
0 likes · 6 min read
Using IntelliJ IDEA Live Templates to Simplify Java Stream Collectors
Top Architect
Top Architect
Mar 7, 2021 · Fundamentals

Java 8 Functional Interfaces and Stream Operations: A Comprehensive Guide

This article explains Java 8's functional interfaces, lambda expressions, method references, lazy versus eager evaluation, and demonstrates how to use the Stream API—including collect, filter, map, flatMap, max/min, count, reduce, and various collectors—to write concise, expressive code for processing collections.

CollectorsFunctional InterfacesJava
0 likes · 15 min read
Java 8 Functional Interfaces and Stream Operations: A Comprehensive Guide
Programmer DD
Programmer DD
Oct 11, 2020 · Fundamentals

Unlock Java 8: Master Lambda Expressions and Stream API with Real Code Examples

This article introduces Java 8’s key functional programming features—lambda expressions, functional interfaces, and the Stream API—explaining concepts such as lazy and eager evaluation, and demonstrating common operations like filter, map, flatMap, collect, reduce, and grouping with clear code examples.

CollectorsFunctional InterfacesJava 8
0 likes · 15 min read
Unlock Java 8: Master Lambda Expressions and Stream API with Real Code Examples
Java Captain
Java Captain
Sep 13, 2020 · Fundamentals

Java 8 Lambda Expressions, Functional Interfaces, and Stream API Tutorial

This article introduces Java 8's lambda expressions and functional interfaces, demonstrates their usage with examples, and explains how to leverage the Stream API—including operations like filter, map, flatMap, reduce, collect, and grouping—to process collections efficiently.

CollectorsFunctional InterfacesJava
0 likes · 15 min read
Java 8 Lambda Expressions, Functional Interfaces, and Stream API Tutorial