File tree Expand file tree Collapse file tree 4 files changed +6
-33
lines changed
test/java/org/hamcrest/collection Expand file tree Collapse file tree 4 files changed +6
-33
lines changed Original file line number Diff line number Diff line change 1
1
package org .hamcrest ;
2
2
3
3
import org .hamcrest .collection .MatchArrays ;
4
+ import org .hamcrest .collection .MatchIterables ;
4
5
import org .hamcrest .number .MatchNumbers ;
5
6
import org .hamcrest .object .MatchObjects ;
6
7
import org .hamcrest .text .MatchStrings ;
@@ -939,7 +940,7 @@ public static <E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> contains
939
940
* @param sizeMatcher a matcher for the number of items that should be yielded by an examined {@link Iterable}
940
941
*/
941
942
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 );
943
944
}
944
945
945
946
/**
@@ -952,7 +953,7 @@ public static <E> org.hamcrest.Matcher<java.lang.Iterable<E>> iterableWithSize(o
952
953
* @param size the number of items that should be yielded by an examined {@link Iterable}
953
954
*/
954
955
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 );
956
957
}
957
958
958
959
/**
Original file line number Diff line number Diff line change 5
5
6
6
import java .util .Iterator ;
7
7
8
- import static org .hamcrest .core .IsEqual .equalTo ;
9
-
10
8
public class IsIterableWithSize <E > extends FeatureMatcher <Iterable <E >, Integer > {
11
9
12
10
public IsIterableWithSize (Matcher <? super Integer > sizeMatcher ) {
@@ -23,31 +21,4 @@ protected Integer featureValueOf(Iterable<E> actual) {
23
21
return size ;
24
22
}
25
23
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
- }
53
24
}
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ public static <E> Matcher<Iterable<E>> iterableWithSize(Matcher<? super Integer>
358
358
* @param size the number of items that should be yielded by an examined {@link Iterable}
359
359
*/
360
360
public static <E > Matcher <Iterable <E >> iterableWithSize (int size ) {
361
- return IsIterableWithSize . iterableWithSize (equalTo (size ));
361
+ return iterableWithSize (equalTo (size ));
362
362
}
363
363
364
364
public static <T > Matcher <Iterable <? extends T >> hasSubsequence (List <Matcher <? super T >> matchers ) {
Original file line number Diff line number Diff line change 6
6
import java .util .Arrays ;
7
7
import java .util .Collections ;
8
8
9
- import static org .hamcrest .collection .IsIterableWithSize .iterableWithSize ;
9
+ import static org .hamcrest .collection .MatchIterables .iterableWithSize ;
10
+
10
11
11
12
public class IsIterableWithSizeTest extends AbstractMatcherTest {
12
13
You can’t perform that action at this time.
0 commit comments