You can do it with groupingBy.

Assuming that your input is a List<Dog>, the Map member inside the Dog class is called map, and the Breed is stored for the "Breed" key :

List<Dog> dogs = ...
Map<String, List<Dog>> map = dogs.stream()
     .collect(Collectors.groupingBy(d -> d.map.get("Breed")));
Answer from Eran on Stack Overflow
๐ŸŒ
Medium
medium.com โ€บ geekculture โ€บ java-streams-collect-to-map-of-lists-with-grouping-by-8cb309df4598
Java Streams: Collect to Map of Lists with Grouping By | Geek Culture
May 7, 2022 - How to collect a stream into a map of lists, to avoid duplicate key exception, using the Collectors . groupingBy method method reference lambda functions
Discussions

Convert a list of maps to a map of lists using Java Streams - Stack Overflow
See also: Convert a map of lists into a list of maps ... Find the answer to your question by asking. More on stackoverflow.com
๐ŸŒ stackoverflow.com
Need help with creating a map from a list with stream
https://www.baeldung.com/java-list-to-map#after-java8 More on reddit.com
๐ŸŒ r/javahelp
7
2
September 28, 2023
lambda - Java 8 List<V> into Map<K, V> - Stack Overflow
I want to translate a List of objects into a Map using Java 8's streams and lambdas. This is how I would write it in Java 7 and below: private Map nameMap(List c... More on stackoverflow.com
๐ŸŒ stackoverflow.com
hashmap - Java 8 streams: iterate over Map of Lists - Stack Overflow
The value of the result map ist the Property "name" of My object, ordered by priority. The ordering and extracting the name is not the problem, but I could not put it into the result map. I do it the old Java 7 way, but it would be nice it is possible to use the streaming API. Map More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
HowToDoInJava
howtodoinjava.com โ€บ home โ€บ java 8 โ€บ java collectors.tomap(): collecting stream items into map
Java Collectors.toMap(): Collecting Stream Items into Map
October 14, 2023 - We saw the examples of each approach and their outputs for a better understanding of what each approach does to Stream items. Happy Learning !! ... If you wish to create map from list by id, but list contains duplicates you can use Collectors.toMap with BinnaryOperator:
๐ŸŒ
amitph
amitph.com โ€บ home โ€บ java โ€บ examples of converting list to map using streams
Examples of Converting List to Map using Streams | amitph
November 22, 2024 - The Java Stream Collectors.toMap() is a convenient method for creating maps. The method accepts two Functions โ€“ the first for mapping the key and the other for mapping the value.
๐ŸŒ
Medium
neesri.medium.com โ€บ how-to-convert-a-stream-to-list-set-map-and-different-types-of-collections-1902c849e34a
How to Convert a Stream to List, Set, Map and different types of collections. | by A cup of JAVA coffee with NeeSri | Medium
July 25, 2025 - In Java, Streams are powerful tools that allow you to process collections in a functional way. You can convert a Stream into different types of collections like List, Set, or Map using the Collectors class.
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ java-convert-map-to-list
Java 8: How to Convert a Map to List
October 10, 2023 - If we have a two-dimensional Stream or a Stream of Streams, we can flatten it into a single one. This is conceptually very similar to what we're trying to do - convert a 2D Collection into a 1D Collection. Let's mix things up a bit by creating a Map<K,V> where the keys are of type Integer while the values are of type List<String>:
Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/javahelp โ€บ need help with creating a map from a list with stream
r/javahelp on Reddit: Need help with creating a map from a list with stream
September 28, 2023 -

I have a list of objects (let's say object has string a, string b, string c ) need to convert it into map with key as a+b and value as entire object. Is this possible? Please help.

I m trying like this syntax: list.stream().collect(Collectors.toMap(key, value)); But not able to set key value as concatenation of a and b.

๐ŸŒ
How to do in Java
howtodoinjava.com โ€บ home โ€บ collections framework โ€บ convert list to map in java
Convert List to Map in Java
September 23, 2022 - Since Java version 1.8, we can have Streams and collectors to convert a List into a Map by using toMap() method. Map<Integer, Employee> employeeMap = uniqueEmployeeList.stream() .collect(Collectors.toMap(Employee::id, Function.identity())); ...
๐ŸŒ
Marc Nuri
blog.marcnuri.com โ€บ home โ€บ java streams: convert list into map
Java Streams: Convert List into Map - Marc Nuri
January 27, 2026 - Convert a List to a Map using Java Streams and Collectors.toMap(). Covers handling duplicates, order, immutable maps, and null values.
๐ŸŒ
Dba-presents
dba-presents.com โ€บ jvm โ€บ java โ€บ 262-convert-list-to-map-with-java-streams
Convert List to Map with Java Streams
August 13, 2022 - The simplest case is when the key and value of the final map are already fields on the list of elements. In my case, a key will be a city id and a value will be a city name. Map<Integer, String> idToName = cities.stream().collect(Collectors.toMap(City::getId, City::getName)); I used method references to define the mapping. Even if the above case was obvious to you, you may wonder how to tell Java that a value (or key) should be the whole original object, not its field.
๐ŸŒ
Blogger
javarevisited.blogspot.com โ€บ 2016 โ€บ 04 โ€บ 10-examples-of-converting-list-to-map.html
10 Examples of Converting a List to Map in Java 8
private Map<String, Choice> toMap(List books) { final Map hashMap = new HashMap<>(); for (final Book book : books) { hashMap.put(book.getISBN(), book); } return hashMap; } You can see we have iterated through the List using enhanced for loop of Java 5 and put each element into a HashMap, where ISBN code is the key, and the book object itself is the value. This is the best way to convert a List to Map in pre-JDK 8 worlds. It's clear, concise, and self-explanatory, but iterative. Now, let's see how we can do the same in Java 8 by using lambda expression and Stream API, here is my first attempt:
๐ŸŒ
Mkyong
mkyong.com โ€บ home โ€บ java8 โ€บ java 8 โ€“ convert list to map
Java 8 โ€“ Convert List to Map | mkyong.com
May 26, 2017 - Map<String, Long> result1 = list.stream().collect( Collectors.toMap(Hosting::getName, Hosting::getWebsites, (oldValue, newValue) -> newvalue ) ); ... package com.mkyong.java8; import java.util.*; import java.util.stream.Collectors; public class TestSortCollect { public static void main(String[] args) { List<Hosting> list = new ArrayList<>(); list.add(new Hosting(1, "liquidweb.com", 80000)); list.add(new Hosting(2, "linode.com", 90000)); list.add(new Hosting(3, "digitalocean.com", 120000)); list.add(new Hosting(4, "aws.amazon.com", 200000)); list.add(new Hosting(5, "mkyong.com", 1)); list.add(n
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ program-to-convert-list-to-map-in-java
Program to Convert List to Map in Java - GeeksforGeeks
April 9, 2026 - Create a List of objects. Convert the List into a Stream using stream(). Use Collectors.toMap() to specify the key and value. Collect the elements into a Map. ... import java.util.*; import java.util.stream.Collectors; class Student { private ...
๐ŸŒ
Coderanch
coderanch.com โ€บ t โ€บ 680277 โ€บ java โ€บ Creating-map-maps-list-Java
Creating a map of maps from a list using Java 8 streams [Solved] (Java in General forum at Coderanch)
The key of the first map is MonitoredData::getDayOfYear and the key to the second map is MonitoredData::getActivityLabel. The value of the second data should be the number of times the certain activity has been found in that specific day. Thanks in advance, tell me if there's something else ...
๐ŸŒ
Blogger
javarevisited.blogspot.com โ€บ 2021 โ€บ 09 โ€บ java-8-stream-flatmap-example-list-of.html
Java 8 - Stream FlatMap Example - List of Lists to List
July 24, 2022 - Btw, if you haven't started Java ... lambda expressions and Stream API. This is one of the simplest examples of flatmap in Java 8. As I said before, flatMap can do two things, it can transform objects just like a map and it can also flatten a list or Stream....
๐ŸŒ
Medium
medium.com โ€บ @pravinkottawarcse โ€บ how-to-conver-a-list-to-map-using-java-stream-d3a9e41e6658
How to convert a list to map using java stream? | by Pravin Kottawar | Medium
December 10, 2022 - List can have duplicate names so ... of method reference is also required. ... The Java Stream Collectors.toMap() is a convenient method for creating maps....