Java Lambda - DoublePredicate test example

DoublePredicate test evaluates this predicate on the given argument.


test has the following syntax.

boolean test(double value)


The following example shows how to use test.

import java.util.function.DoublePredicate;
// ww  w .  j ava2s  .  c om
public class Main {

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



The code above generates the following result.