materialize

Returns the ArgMatcher object behind matcher. A literal value is returned as ArgMatcher.Equals.

It is the inverse of matches: materialize(matches(matcher)) returns matcher.


Like single-value materialize, but for many matchers at once, including vararg parameters marked with Matcher. Returns their ArgMatcher objects in order.

Matchers and literal values can be mixed. A vararg parameter must be passed with the spread operator:

fun <T> MokkeryMatcherScope.oneOf(@Matcher first: T, @Matcher vararg others: T): T {
return matches(LogicalMatchers.Or(materialize(first, *others)))
}