Is there a shorter version of the following assert statement using standard Hamcrest matchers?
Collection<Element> collection = ...
assertThat(collection, is(anyOf(nullValue(Collection.class),
emptyCollectionOf(Element.class))));
I realize there is a way to create a custom matcher, was hoping that maybe there is already something in place that addresses this without any additional code change.
null
in place of an empty collection. – Defamatory