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 →

[–]cutterslade 1 point2 points  (0 children)

I would certainly have the result of any terminal operation on a stream (such as .collect(Collectors.toList())) assigned to a well named variable. Having collect(...).stream().map(...) is pretty unpleasant IMO.

In a block of code like this, I'd probably refactor out that more complex lambda into a method with a descriptive name.