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)
| 710 | |
| 711 | |
| 712 | public static <T> T find(Iterator<T> iterator, Predicate<? super T> predicate) { |
| 713 | return filter(iterator, predicate).next(); |
| 714 | } |
| 715 | |
| 716 | /** |
| 717 | * Returns the first element in {@code iterator} that satisfies the given |