// given a set of Item objects, group them by the managers of creator and owners
Map> managersItems =
itemSet.parallelStream().fl
You didn't do anything wrong. Eclipse compiler has problems with type inference that causes these issues. If Luna compatibility is important, you will have to add explicit types to lambda expressions. Try, for example, Map.Entry::
On another note, it's not necessary to convert a List
to array to stream it. You can directly call users.stream()
. But even creating the List
isn't necessary. You can use Stream.concat(Stream.of(item.getCreator()), item.getOwners().stream())
instead (granted, it's a bit unwieldy).
Finally (and most importantly), avoid using parallelStream
with blocking code, such as looking up data in an external system. Parallel streams are designed to handle CPU-bound tasks.