Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Apache Commons Bag and Guava MultiSet?

It seems that those two are exactly same, any confirms?

like image 982
Adam Lee Avatar asked Dec 05 '22 18:12

Adam Lee


1 Answers

Primarily this: Multiset follows the Collection contract precisely, and generally plays better with other JDK collections utilities. Additionally, Multiset has generics support, supports the entrySet() method, and the setCount method, none of which appear to be offered by Bag.

They serve the same purpose, as you can clearly tell, but I'd like to think that Multiset wins in most respects.

like image 103
Louis Wasserman Avatar answered Dec 07 '22 08:12

Louis Wasserman