I’m starting to use the Guava classes and stumbling about the missing constructors.
I have a method that gets a LinkedHashMultiset<String>. How do I create a new argument in the method call?
class.method(LinkedHashMultiset.create()); makes the compiler complain that there is no method for class.method(LinkedHashMultiset<Object>).
And class.method((LinkedHashMultiset<String)LinkedHashMultiset.create()) fails due to an impossible cast.
One way is the following:
One other is this: