Returns true if iterable contains any object for which equals(element) is true.
(Iterable<?> iterable, @Nullable Object element)
| 116 | * is true. |
| 117 | */ |
| 118 | public static boolean contains(Iterable<?> iterable, @Nullable Object element) { |
| 119 | if (iterable instanceof Collection) { |
| 120 | Collection<?> collection = (Collection<?>) iterable; |
| 121 | return Collections2.safeContains(collection, element); |
| 122 | } |
| 123 | return Iterators.contains(iterable.iterator(), element); |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Removes, from an iterable, every element that belongs to the provided |
no test coverage detected