Replace orElseGet by orElseThrow to throw an error
@@ -1200,9 +1200,7 @@ public class Iterables {
predicates.assertIsNotNull(predicate);
stream(actual).filter(predicate)
.findFirst()
- .orElseGet(() -> {
- throw failures.failure(info, anyElementShouldMatch(actual, predicateDescription));
- });
+ .orElseThrow(() -> failures.failure(info, anyElementShouldMatch(actual, predicateDescription)));
}
public <E> void assertNoneMatch(AssertionInfo info, Iterable<? extends E> actual, Predicate<? super E> predicate,
