Example usage for java.util.function BiPredicate or

List of usage examples for java.util.function BiPredicate or

Introduction

In this page you can find the example usage for java.util.function BiPredicate or.

Prototype

default BiPredicate<T, U> or(BiPredicate<? super T, ? super U> other) 

Source Link

Document

Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.

Usage

From source file:Main.java

public static void main(String[] args) {
    BiPredicate<Integer, Integer> bi = (x, y) -> x > y;

    BiPredicate<Integer, Integer> eq = (x, y) -> x - 2 > y;

    System.out.println(bi.test(2, 3));
    System.out.println(bi.or(eq).test(2, 3));
    System.out.println(bi.or(eq).test(8, 3));
}