That’s what flatMap is for :
List<B> bList = aList.stream()
.flatMap(a -> a.bList.stream())
.collect(Collectors.toList());
More Related Contents:
- How to convert to Java 8 map grouping by Map [closed]
- Java 8 List into Map
- Collection to stream to a new collection
- How to convert a Java 8 Stream to an Array?
- In Java, what are the advantages of streams over loops? [closed]
- How to sum a list of integers with java streams?
- Java 8 stream’s .min() and .max(): why does this compile?
- Why does Stream not implement Iterable?
- How can I create a stream from an array?
- In Java 8, is there a ByteStream class?
- Sum values from specific field of the objects in a list
- Files.walk(), calculate total size
- Does Stream.forEach respect the encounter order of sequential streams?
- Most efficient way to get the last element of a stream
- Why does findFirst() throw a NullPointerException if the first element it finds is null?
- Sort map by value using lambdas and streams
- Java 8 Stream IllegalStateException: Stream has already been operated on or closed
- Equivalent of Scala dropWhile
- Why does Stream.allMatch() return true for an empty stream?
- Modifying Objects within stream in Java8 while iterating
- Take every nth element from a Java 8 stream
- How to sum values in a Map with a stream?
- Static context cannot access non-static in Collectors
- What Java 8 Stream.collect equivalents are available in the standard Kotlin library?
- Java 8, how can I implement a switch statement using streams?
- Adding two Java 8 streams, or an extra element to a stream
- Convert String array to Map using Java 8 Lambda expressions
- Visualization of Java Stream parallelization
- Java 8 stream map to list of keys sorted by values
- Java Stream API – count items of a nested list