The method doSomethingWith(Stream<T> s) was using a forEach() that consumed the stream. Replacing it with a map() did the trick. Thanks, I like the solution.