Round 1 feedback

Michael Nascimento misterm at
Wed Feb 13 20:32:13 PST 2013

On Wed, Jan 9, 2013 at 2:13 PM, Brian Goetz <brian.goetz at> wrote:
> What we did in 8 is add {Map,ConcurrentMap}.computeIfAbsent.  This
> eliminates 80% of the pain of simulating a multimap with a
> Map<K,Collection<V>>.  To wit:
> void add(K k, V v) {
>   map.computeIfAbsent(k, ArrayList::new).add(v);
> }
> This is only slightly worse than
>   multimap.add(k, v);
> and certainly way less pain than doing it today.
> With this tweak, I think the argument in favor of adding Multimap to the JDK
> loses about 80% of its steam.

Ok, now to a different point of the Multimap discussion. Turning this:

Collection<Foo<Bar>> values = fooBySomething.values();

into this:

Collection<Foo<Bar>> values =
fooBySomething.values().stream().<Foo<Bar>>explode((d, foos) ->

is pretty ugly, isn't it? Or is there a better way?


More information about the lambda-dev mailing list