When building composite matchers programmatically the fluent style can be awkward to work with. For example, composing a list of matchers requires compose() to be invoked for the first one and then and() for the subsequent ones. For this use case we should provide a compose(List<Matcher<T>> matchers) factory method.
When building composite matchers programmatically the fluent style can be awkward to work with. For example, composing a list of matchers requires
compose()
to be invoked for the first one and thenand()
for the subsequent ones. For this use case we should provide acompose(List<Matcher<T>> matchers)
factory method.