Collection matchers cannot take a collection of elements
The matchers IsIterableContaining, IsIterableContainingInRelativeOrder, IsIterableContainingInOrder and IsIterableContainingInAnyOrder all have methods accepting
- further matchers as a varargs parameter
- a collection of matchers
- expected elements as a varargs parameter
They are all missing a method taking the expected elements as a Collection<E> or Iterable<E>. If you already have a list of expected elements, you always have to convert it into an array in order to use these matchers.
Is there a reason why these methods are missing? Otherwise I could create a pull request to add them.
I haven't checked, but I would guess that since the generic types are stripped from the compiled code, then the Java runtime would not be able to differentiate a parameter of Collection<T> from Collection<Matcher<T>>.
The API is a bit of a mess and one of the things that contributes to that is Java's brittle type system. Things that involve two levels of generic <ListOf<Thing>> cost me a year of my life.