, breaking the stream chain
, Stream
, Stream
, . terminal operations
, , , forEach
Stream<T>
, , , intermediate
forEach forEach.
, :
myStream.map(obj -> {obj.foo(); return obj;}
. , , Stream
( foo
):
myStream.map(Obj::foo) // this will turn into Stream<T>, where T is
// the return type of foo, instead of Stream<Obj>
, map
stateful
, . , , . map
stateless
.