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)
| 153 | * @return {@code true} if any element was removed from {@code iterable} |
| 154 | */ |
| 155 | @CanIgnoreReturnValue |
| 156 | public static boolean retainAll(Iterable<?> removeFrom, Collection<?> elementsToRetain) { |
| 157 | return (removeFrom instanceof Collection) |
| 158 | ? ((Collection<?>) removeFrom).retainAll(checkNotNull(elementsToRetain)) |
| 159 | : Iterators.retainAll(removeFrom.iterator(), elementsToRetain); |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Removes, from an iterable, every element that satisfies the provided |
nothing calls this directly
no test coverage detected