`Stream` is a very "uncertain" and therefore bad abstraction for any declarations: methods and even local variables. It's even more "uncertain" than `Iterable`, because you don't know if the stream is parallel or not, and you cannot iterate it multiple times. When you operate with a method that returns a Stream, you *have* to go to the declaration of that method and read how that stream was created, to understand what is going on in general. It makes it harder to analyze methods in separation and forces you to keep more information in your head at the same time.
So `Stream` works best only in stream chains that end with terminal operations, and that are wholly observable by one sight because they span several lines of code. But when Stream crosses the borders of methods and classes, it complicates understanding of the code. I understand using Streams in method return types when you want to avoid extra collection materializations, but not when returning a `Collection` (or even better a `Set`) is executionally the same thing. [ Full content available at: https://github.com/apache/incubator-druid/pull/5913 ] This message was relayed via gitbox.apache.org for [email protected]
