public static <T> Collector<Collection<T>, List<T>, List<T>> toFlatList() {
        return Collector.of(
                ArrayList::new,
                List::addAll,
                (left, right) -> {
                    left.addAll(right);
                    return left;
                });
    }
public static <T> Collector<Collection<T>, List<T>, List<T>> toFlatList() {
        return Collector.of(
                ArrayList::new,
                List::addAll,
                (left, right) -> {
                    left.addAll(right);
                    return left;
                });
    }
public static < T > Collector < Collection < T > , List < T > , List < T > > toFlatList ( ) { return Collector . of ( ArrayList :: new , List :: addAll , ( left , right ) -> { left . addAll ( right ) ; return left ; } ) ; }
Flattening collector.
Look at StreamCollectorsTest for example usage


@param <T> type of elements in the collections
@return flattened list of elements from all of the collections
Flattening collector . Look at StreamCollectorsTest for example usage