### Question:
CollectionItemMatcher extends ElementMatcher.Junction.AbstractBase<Iterable<? extends T>> { public boolean matches(Iterable<? extends T> target) { for (T value : target) { if (matcher.matches(value)) { return true; } } return false; } CollectionItemMatcher(ElementMatcher<? super T> matcher); boolean matches(Iterable<? extends T> target); @Override String toString();  }### Answer:
@Test public void testMatchFirst() throws Exception { when(elementMatcher.matches(first)).thenReturn(true); assertThat(new CollectionItemMatcher<Object>(elementMatcher).matches(iterable), is(true)); verify(elementMatcher).matches(first); verifyNoMoreInteractions(elementMatcher); }
@Test public void testMatchSecond() throws Exception { when(elementMatcher.matches(first)).thenReturn(false); when(elementMatcher.matches(second)).thenReturn(true); assertThat(new CollectionItemMatcher<Object>(elementMatcher).matches(iterable), is(true)); verify(elementMatcher).matches(first); verify(elementMatcher).matches(second); verifyNoMoreInteractions(elementMatcher); }
@Test public void testNoMatch() throws Exception { when(elementMatcher.matches(first)).thenReturn(false); when(elementMatcher.matches(second)).thenReturn(false); assertThat(new CollectionItemMatcher<Object>(elementMatcher).matches(iterable), is(false)); verify(elementMatcher).matches(first); verify(elementMatcher).matches(second); verifyNoMoreInteractions(elementMatcher); }