vavr
vavr copied to clipboard
Collect to map while dealing with collisions
I would like to collect a stream of objects into a map, while dealing with duplicate keys analogous to the Java collector Collectors::toMap(Function, Function, BinaryOperator). Is there a canonical way of doing that?
Will Traversable.toMap do what you want?
Of course, yes, I think that's what I was looking for. Edit: I think this method is not available in the pre-alpha versions. Guess I need to upgrade.