Ternary predicate

Report a typo

Write your own functional interface called TernaryIntPredicate and use it with a lambda expression. The interface must have a single non-static (and non-default) method called test that accepts three int arguments and returns a boolean value.

Also, write a lambda expression of the TernaryIntPredicate type with three int arguments.
The lambda expression should return true if all passed values are different, otherwise it should return false. The expression should be assigned to a static field named ALL_DIFFERENT.

There is a template to be used for your solution. Please, do not change it.

Sample Input 1:

1 1 1

Sample Output 1:

False

Sample Input 2:

2 3 4

Sample Output 2:

True
Write a program in Java 17
class Predicate {
public static final TernaryIntPredicate ALL_DIFFERENT = // Write a lambda expression here

@FunctionalInterface
public interface TernaryIntPredicate {
// Write a method here
}
}
___

Create a free account to access the full topic