Languages

Java 8 - how to convert Map<String, Set<String>> to Map<String, List<String>> using streams?

5 points
Asked by:
illona
316

How to quickly convert Map<String, Set<String>> to Map<String, List<String>> using streams?

eg:

// input:
Map<String, Set<String>> map1 = new LinkedHashMap<>();

// output:
Map<String, List<String>> map2 = new LinkedHashMap<>();

I don't want the java 7 way, I would like to convert it in one stream.

0 answers
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join