An empty stream will always return false;
package com.logicbig.example.stream;
import java.util.Arrays;
public class AnyMatchExample {
public static void main(String... args) {
boolean b = Arrays.asList()
.stream()
.anyMatch(e -> true);
System.out.println(b);
}
}
Output
false