@Test public void test_match_2() { assertThat(6, SomeOfChainMatcher .matches(2).of( notNullValue(), lessThan(3), greaterThan(4))); }
@Override public boolean matches(Object item) { int count = 0; for (Matcher<?> m: matchers) { if (m.matches(item)) { count++; } } return countMatcher.matches(count); }
SomeOfChainMatcher extends MatcherChainBase<T> { @Override public boolean matches(Object item) { int count = 0; for (Matcher<?> m: matchers) { if (m.matches(item)) { count++; } } return countMatcher.matches(count); } }
SomeOfChainMatcher extends MatcherChainBase<T> { @Override public boolean matches(Object item) { int count = 0; for (Matcher<?> m: matchers) { if (m.matches(item)) { count++; } } return countMatcher.matches(count); } SomeOfChainMatcher(Matcher<? super Integer> countMatcher, Matcher<? super T>... matchers);  SomeOfChainMatcher(Matcher<? super Integer> countMatcher, Collection<? extends Matcher<? super T>> matchers); }
SomeOfChainMatcher extends MatcherChainBase<T> { @Override public boolean matches(Object item) { int count = 0; for (Matcher<?> m: matchers) { if (m.matches(item)) { count++; } } return countMatcher.matches(count); } SomeOfChainMatcher(Matcher<? super Integer> countMatcher, Matcher<? super T>... matchers);  SomeOfChainMatcher(Matcher<? super Integer> countMatcher, Collection<? extends Matcher<? super T>> matchers); @Override int getDescriptionPrecedence(); @Override void describeTo(Description description); @Override boolean matches(Object item); @Override MatchResult<I> matchResult(I item); @Factory static SomeOfChainFactory matches(int count); @Factory static SomeOfChainFactory matches(Matcher<? super Integer> countMatcher); @Factory static Builder<T> matches(int count, Matcher<? super T>... matchers); @Factory static Builder<T> matches(Matcher<? super Integer> countMatcher, Matcher<? super T>... matchers); @Factory Builder<T> oneOf(Matcher<? super T>... matchers); @Factory Builder<T> oneOf(Collection<? extends Matcher<? super T>> matcher); static SomeOfChainFactory factory(int count); static SomeOfChainFactory factory(Matcher<? super Integer> countMatcher); }
SomeOfChainMatcher extends MatcherChainBase<T> { @Override public boolean matches(Object item) { int count = 0; for (Matcher<?> m: matchers) { if (m.matches(item)) { count++; } } return countMatcher.matches(count); } SomeOfChainMatcher(Matcher<? super Integer> countMatcher, Matcher<? super T>... matchers);  SomeOfChainMatcher(Matcher<? super Integer> countMatcher, Collection<? extends Matcher<? super T>> matchers); @Override int getDescriptionPrecedence(); @Override void describeTo(Description description); @Override boolean matches(Object item); @Override MatchResult<I> matchResult(I item); @Factory static SomeOfChainFactory matches(int count); @Factory static SomeOfChainFactory matches(Matcher<? super Integer> countMatcher); @Factory static Builder<T> matches(int count, Matcher<? super T>... matchers); @Factory static Builder<T> matches(Matcher<? super Integer> countMatcher, Matcher<? super T>... matchers); @Factory Builder<T> oneOf(Matcher<? super T>... matchers); @Factory Builder<T> oneOf(Collection<? extends Matcher<? super T>> matcher); static SomeOfChainFactory factory(int count); static SomeOfChainFactory factory(Matcher<? super Integer> countMatcher);  }