Search code examples
javapredicatefunctional-interface

Java interface like Predicate, but without an argument


I'm looking for a preexisting functional interface like Predicate, but one whose test method takes no arguments.


Solution

  • You're looking for BooleanSupplier.

    https://docs.oracle.com/javase/8/docs/api/java/util/function/BooleanSupplier.html