File tree Expand file tree Collapse file tree
test/java/org/hamcrest/collection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .hamcrest ;
22
33import org .hamcrest .collection .MatchArrays ;
4+ import org .hamcrest .collection .MatchIterables ;
45import org .hamcrest .number .MatchNumbers ;
56import org .hamcrest .object .MatchObjects ;
67import org .hamcrest .text .MatchStrings ;
@@ -939,7 +940,7 @@ public static <E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> contains
939940 * @param sizeMatcher a matcher for the number of items that should be yielded by an examined {@link Iterable}
940941 */
941942 public static <E > org .hamcrest .Matcher <java .lang .Iterable <E >> iterableWithSize (org .hamcrest .Matcher <? super java .lang .Integer > sizeMatcher ) {
942- return org . hamcrest . collection . IsIterableWithSize .iterableWithSize (sizeMatcher );
943+ return MatchIterables .iterableWithSize (sizeMatcher );
943944 }
944945
945946 /**
@@ -952,7 +953,7 @@ public static <E> org.hamcrest.Matcher<java.lang.Iterable<E>> iterableWithSize(o
952953 * @param size the number of items that should be yielded by an examined {@link Iterable}
953954 */
954955 public static <E > org .hamcrest .Matcher <java .lang .Iterable <E >> iterableWithSize (int size ) {
955- return org . hamcrest . collection . IsIterableWithSize .iterableWithSize (size );
956+ return MatchIterables .iterableWithSize (size );
956957 }
957958
958959 /**
Original file line number Diff line number Diff line change 55
66import java .util .Iterator ;
77
8- import static org .hamcrest .core .IsEqual .equalTo ;
9-
108public class IsIterableWithSize <E > extends FeatureMatcher <Iterable <E >, Integer > {
119
1210 public IsIterableWithSize (Matcher <? super Integer > sizeMatcher ) {
@@ -23,31 +21,4 @@ protected Integer featureValueOf(Iterable<E> actual) {
2321 return size ;
2422 }
2523
26- /**
27- * Creates a matcher for {@link Iterable}s that matches when a single pass over the
28- * examined {@link Iterable} yields an item count that satisfies the specified
29- * matcher.
30- * For example:
31- * <pre>assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))</pre>
32- *
33- * @param sizeMatcher
34- * a matcher for the number of items that should be yielded by an examined {@link Iterable}
35- */
36- public static <E > Matcher <Iterable <E >> iterableWithSize (Matcher <? super Integer > sizeMatcher ) {
37- return new IsIterableWithSize <>(sizeMatcher );
38- }
39-
40- /**
41- * Creates a matcher for {@link Iterable}s that matches when a single pass over the
42- * examined {@link Iterable} yields an item count that is equal to the specified
43- * <code>size</code> argument.
44- * For example:
45- * <pre>assertThat(Arrays.asList("foo", "bar"), iterableWithSize(2))</pre>
46- *
47- * @param size
48- * the number of items that should be yielded by an examined {@link Iterable}
49- */
50- public static <E > Matcher <Iterable <E >> iterableWithSize (int size ) {
51- return iterableWithSize (equalTo (size ));
52- }
5324}
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ public static <E> Matcher<Iterable<E>> iterableWithSize(Matcher<? super Integer>
358358 * @param size the number of items that should be yielded by an examined {@link Iterable}
359359 */
360360 public static <E > Matcher <Iterable <E >> iterableWithSize (int size ) {
361- return IsIterableWithSize . iterableWithSize (equalTo (size ));
361+ return iterableWithSize (equalTo (size ));
362362 }
363363
364364 public static <T > Matcher <Iterable <? extends T >> hasSubsequence (List <Matcher <? super T >> matchers ) {
Original file line number Diff line number Diff line change 66import java .util .Arrays ;
77import java .util .Collections ;
88
9- import static org .hamcrest .collection .IsIterableWithSize .iterableWithSize ;
9+ import static org .hamcrest .collection .MatchIterables .iterableWithSize ;
10+
1011
1112public class IsIterableWithSizeTest extends AbstractMatcherTest {
1213
You can’t perform that action at this time.
0 commit comments