MCPcopy Create free account
hub / github.com/antlr/codebuff / contains

Method contains

corpus/java/training/guava/collect/Iterables.java:118–124  ·  view source on GitHub ↗

Returns true if iterable contains any object for which equals(element) is true.

(Iterable<?> iterable, @Nullable Object element)

Source from the content-addressed store, hash-verified

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

Callers 1

containsMethod · 0.95

Calls 3

safeContainsMethod · 0.95
containsMethod · 0.95
iteratorMethod · 0.65

Tested by

no test coverage detected