Java Lambda - LongPredicate test example

LongPredicate test evaluates this predicate on the given argument.


test has the following syntax.

boolean test(long value)


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;

The code above generates the following result.