Open
Description
I have a value where it can either be null, or if non-null it must match a pattern.
So I'd like to be able to do something like
assertThat(value).any(
{ a -> a.isNull() },
{ a -> isNotNull().matches(Regex("""some pattern""")) }
)
The existing code I'm converting from Java and AssertJ is using anyOf(Condition...)
to do this.
I guess matchesPredicate
is possible as a last resort, but it removes all potential for reusing existing assertions. :(