in core/src/main/java/org/apache/commons/functor/core/algorithm/FindWithinGenerator.java [111:121]
public E evaluate(Generator<? extends E> left, Predicate<? super E> right) {
FindProcedure<E> findProcedure = new FindProcedure<E>(right);
left.run(findProcedure);
if (!findProcedure.wasFound) {
if (useIfNone) {
return ifNone;
}
throw new NoSuchElementException("No element matching " + right + " was found.");
}
return findProcedure.found;
}