public static < A , B > Multiset < B > mutableTransformedCopy ( Multiset < A > ms , Function < A , B > func ) { final Multiset < B > ret = HashMultiset . create ( ) ; for ( final Multiset . Entry < A > entry : ms . entrySet ( ) ) { final B transformedElement = func . apply ( entry . getElement ( ) ) ; ret . add ( transformedElement , entry . getCount ( ) ) ; } return ret ; }
Same as transformedCopy except the returned Multiset is mutable .