This terminal-short-circuiting operation returns whether all elements match the provided predicate criteria. It returns 'false' on finding the first mismatch hence short-circuiting the operation.
If the stream is empty then this method returns true and the predicate is not evaluated.
Examples
package com.logicbig.example.doublestream;
import java.util.stream.DoubleStream;
public class AllMatchExample {
public static void main(String... args) { DoubleStream doubleStream = DoubleStream.of(1.2, 1.3, 1.4, 1.5, 1.6); boolean b = doubleStream.allMatch(value -> value < 2.0d); System.out.println(b);