3
3
import org .hamcrest .Matcher ;
4
4
import org .hamcrest .internal .Wrapping ;
5
5
6
- import java .util .ArrayList ;
7
6
import java .util .Collection ;
8
7
import java .util .List ;
9
8
10
- import static java .util .Arrays .asList ;
11
9
import static org .hamcrest .object .MatchObjects .equalTo ;
12
10
13
11
/**
@@ -56,7 +54,7 @@ public static <E> Matcher<Collection<? extends E>> empty() {
56
54
*
57
55
* @param unusedToForceReturnType the type of the collection's content
58
56
*/
59
- @ SuppressWarnings ("unchecked" )
57
+ @ SuppressWarnings ({ "unchecked" , "UnusedParameters" } )
60
58
public static <E > Matcher <Collection <E >> emptyCollectionOf (Class <E > unusedToForceReturnType ) {
61
59
return (Matcher )empty ();
62
60
}
@@ -77,22 +75,6 @@ public static <E> Matcher<Iterable<? extends E>> contains(E... items) {
77
75
return contains (Wrapping .asEqualToMatchers (items ));
78
76
}
79
77
80
- /**
81
- * Creates a matcher for {@link Iterable}s that matches when a single pass over the
82
- * examined {@link Iterable} yields a single item that satisfies the specified matcher.
83
- * For a positive match, the examined iterable must only yield one item.
84
- * For example:
85
- * <pre>assertThat(Arrays.asList("foo"), contains(equalTo("foo")))</pre>
86
- *
87
- * @param itemMatcher
88
- * the matcher that must be satisfied by the single item provided by an
89
- * examined {@link Iterable}
90
- */
91
- @ SuppressWarnings ("unchecked" )
92
- public static <E > Matcher <Iterable <? extends E >> contains (final Matcher <? super E > itemMatcher ) {
93
- return contains (new ArrayList <Matcher <? super E >>(asList (itemMatcher )));
94
- }
95
-
96
78
/**
97
79
* Creates a matcher for {@link Iterable}s that matches when a single pass over the
98
80
* examined {@link Iterable} yields a series of items, each satisfying the corresponding
0 commit comments