Java Lambda - BiPredicate test example








BiPredicate test method evaluates this predicate on the given arguments.

Syntax

test has the following syntax.

boolean test(T t,  U u)

Example

The following example shows how to use test.

import java.util.function.BiPredicate;

public class Main {
  public static void main(String[] args) {
    BiPredicate<Integer, Integer> bi = (x, y) -> x > y;
    System.out.println(bi.test(2, 3));
  }
}

The code above generates the following result.