Java Lambda - LongPredicate test example








LongPredicate test evaluates this predicate on the given argument.

Syntax

test has the following syntax.

boolean test(long value)

Example

The following example shows how to use test.

import java.util.function.LongPredicate;
//from w  w w.j a  v  a  2 s  . c om
public class Main {

  public static void main(String[] args) {
    LongPredicate i = (l) -> l>0;
    
    System.out.println(i.test(Long.MAX_VALUE));
  }
}

The code above generates the following result.