/** * Creates a matcher for {@link Iterable}s that matches when a single pass over the * examined {@link Iterable} yields an item count that satisfies the specified * matcher. * For example: * <pre>assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))</pre> * * @param sizeMatcher * a matcher for the number of items that should be yielded by an examined {@link Iterable} */ public static <E> Matcher<Iterable<E>> iterableWithSize(Matcher<? super Integer> sizeMatcher) { return new IsIterableWithSize<E>(sizeMatcher); }
/** * Creates a matcher for {@link Iterable}s that matches when a single pass over the * examined {@link Iterable} yields an item count that satisfies the specified * matcher. * <p/> * For example: * <pre>assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))</pre> * * @param sizeMatcher * a matcher for the number of items that should be yielded by an examined {@link Iterable} */ @Factory public static <E> Matcher<Iterable<E>> iterableWithSize(Matcher<? super Integer> sizeMatcher) { return new IsIterableWithSize<E>(sizeMatcher); }
/** * Creates a matcher for {@link Iterable}s that matches when a single pass over the * examined {@link Iterable} yields an item count that satisfies the specified * matcher. * For example: * <pre>assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))</pre> * * @param sizeMatcher * a matcher for the number of items that should be yielded by an examined {@link Iterable} */ public static <E> Matcher<Iterable<E>> iterableWithSize(Matcher<? super Integer> sizeMatcher) { return new IsIterableWithSize<E>(sizeMatcher); }
/** * Creates a matcher for {@link Iterable}s that matches when a single pass over the * examined {@link Iterable} yields an item count that satisfies the specified * matcher. * For example: * <pre>assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))</pre> * * @param sizeMatcher * a matcher for the number of items that should be yielded by an examined {@link Iterable} */ public static <E> Matcher<Iterable<E>> iterableWithSize(Matcher<? super Integer> sizeMatcher) { return new IsIterableWithSize<E>(sizeMatcher); }