Skip to content
Advertisement

Merge lists with stream API

I have the following situation

JavaScript

I have to merge all the lists lst from the ListContainer objects from a Map map.

JavaScript

Any idea how, using Java 8 stream API?

Advertisement

Answer

I think flatMap() is what you’re looking for.

For example:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement