Removes, from an iterable, every element that does not belong to the provided collection. This method calls Collection#retainAll if iterable is a collection, and Iterators#retainAll otherwise. @param removeFrom the iterable to (potentially) remove elements from @param el
(Iterable<?> removeFrom, Collection<?> elementsToRetain)
| 162 | */ |
| 163 | |
| 164 | @CanIgnoreReturnValue |
| 165 | public static boolean retainAll(Iterable<?> removeFrom, Collection<?> elementsToRetain) { |
| 166 | return (removeFrom instanceof Collection) |
| 167 | ? ((Collection<?>) removeFrom).retainAll(checkNotNull(elementsToRetain)) |
| 168 | : Iterators.retainAll(removeFrom.iterator(), elementsToRetain); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Removes, from an iterable, every element that satisfies the provided |
nothing calls this directly
no test coverage detected