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

Method find

corpus/java/training/guava/collect/Iterators.java:674–676  ·  view source on GitHub ↗

Returns the first element in iterator that satisfies the given predicate; use this method only when such an element is known to exist. If no such element is found, the iterator will be left exhausted: its hasNext() method will return false. If it is possible that no el

(Iterator<T> iterator, Predicate<? super T> predicate)

Source from the content-addressed store, hash-verified

672 * the given predicate
673 */
674 public static <T> T find(Iterator<T> iterator, Predicate<? super T> predicate) {
675 return filter(iterator, predicate).next();
676 }
677
678 /**
679 * Returns the first element in {@code iterator} that satisfies the given

Callers 1

findMethod · 0.95

Calls 3

filterMethod · 0.95
getNextMethod · 0.95
nextMethod · 0.65

Tested by

no test coverage detected