@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); }
public boolean matches(Iterable<? extends T> target) { for (T value : target) { if (matcher.matches(value)) { return true; } } return false; }
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 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); }
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(); }
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();  }