An implementation of Multiset#retainAll.
(Multiset<?> self, Collection<?> elementsToRetain)
| 925 | */ |
| 926 | |
| 927 | static boolean retainAllImpl(Multiset<?> self, Collection<?> elementsToRetain) { |
| 928 | checkNotNull(elementsToRetain); |
| 929 | Collection<?> collection = |
| 930 | (elementsToRetain instanceof Multiset) |
| 931 | ? ((Multiset<?>) elementsToRetain).elementSet() |
| 932 | : elementsToRetain; |
| 933 | return self.elementSet().retainAll(collection); |
| 934 | } |
| 935 | |
| 936 | /** |
| 937 | * An implementation of {@link Multiset#setCount(Object, int)}. |
no test coverage detected