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