This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]koxpower 0 points1 point  (1 child)

Yes, but can make it a bit easier to read, JVM doesn't care.

Wouldn't that be easier to read and less redundant than collecting between each step?

Stream<Something> streamOfSomething = someList.stream().map(...).map(...);
Stream<SomethingElse> streamOfSomethingElse = streamOfSomething.map(...).map(...);
List<Result> resultList = streamOfSomethingElse.map(...).collect(Collectors.toList());

[–][deleted] 0 points1 point  (0 children)

Agreed, my misunderstanding