static fun <T : Any!, C : RuntimeException!> failWith(@NonNull exception: C): Predicate<T>!
Returns a predicate that will fail with a given RuntimeException. This method is useful for testing other code that is using predicates and how it handles exceptional situations.
exception - C: instance of exception that should be thrown by the created Predicate.
- type of the resulting Predicate.
- type of the RuntimeException.
Return
Predicate<T>!: instance of Predicate.
static fun <T : Any!, C : RuntimeException!> failWith(@NonNull exception: Class<C>): Predicate<T>!
Returns a predicate that will fail with a given RuntimeException. This method is useful for testing other code that is using predicates and how it handles exceptional situations.
exception - Class<C>: class of exception that should be thrown by the created Predicate.
- type of the resulting Predicate.
- type of the RuntimeException.