DoublePredicate test example

Description

DoublePredicate test evaluates this predicate on the given argument.

Syntax

test has the following syntax.


boolean test(double value)

Example

The following example shows how to use test.


import java.util.function.DoublePredicate;
/*  w w  w  . j ava  2 s .  c om*/
public class Main {

  public static void main(String[] args) {
    DoublePredicate dp = (d) -> d > 0;

    System.out.println(dp.test(0.5));

  }
}

The code above generates the following result.