I have stream<A> where
class A { String category();
I would like to get map<String, list<A>> , where the original stream is broken into signatures based on the value of category (). This is pretty trivial if implemented using a for loop, but is it possible to get a more elegant solution using java threads?
Example:
Given {[a, xyz], [a, zyx], [b, abc]} , I would like to get a map:
a -> {[a, xyz], [a, zyx]} b -> {[b, abc]}
source share