This is also just filter().collect(). Probably the thing to do is leave the previous one at the filter() stage, then chain it down here. and call collect() when you want to generate the return value.