I have a object with contains a list of other objects and I want to return a flatmap of the contained objects mapped by some property of the container. Any one if is it poss
You could try something like:
Map> res = operations.parallelStream().filter(s -> s.getTotal() > 10) .collect(groupingBy(Selling::getClientName, mapping(Selling::getProducts, Collector.of(ArrayList::new, List::addAll, (x, y) -> { x.addAll(y); return x; }))));