Java Lambda - LongPredicate example

LongPredicate represents a predicate (boolean-valued function) of one long-valued argument. This is the long-consuming primitive type specialization of Predicate.


  1. LongPredicate test
  2. LongPredicate and
  3. LongPredicate negate
  4. LongPredicate or


The following example shows how to use LongPredicate.

import java.util.function.LongPredicate;
/*  w ww  . j a  v  a 2s. co m*/
public class Main {

  public static void main(String[] args) {
    LongPredicate i = (l) -> l>0;

The code above generates the following result.