1 package club.wpia.gigi.testUtils;
3 import org.hamcrest.BaseMatcher;
4 import org.hamcrest.Description;
5 import org.hamcrest.Matcher;
7 public class ArrayContains<T> extends BaseMatcher<T[]> {
11 public ArrayContains(Matcher<T> containee) {
12 this.containee = containee;
16 public boolean matches(Object item) {
17 Object[] array = (Object[]) item;
18 for (Object t : array) {
19 if (containee.matches(t)) {
27 public void describeTo(Description description) {
28 description.appendText("contains an element that:");
29 containee.describeTo(description);
32 public static <T> ArrayContains<T> contains(final Matcher<T> element) {
33 return new ArrayContains<T>(element);