33import org .hamcrest .Matcher ;
44import org .hamcrest .internal .Wrapping ;
55
6- import java .util .ArrayList ;
76import java .util .Collection ;
87import java .util .List ;
98
10- import static java .util .Arrays .asList ;
119import static org .hamcrest .object .MatchObjects .equalTo ;
1210
1311/**
@@ -56,7 +54,7 @@ public static <E> Matcher<Collection<? extends E>> empty() {
5654 *
5755 * @param unusedToForceReturnType the type of the collection's content
5856 */
59- @ SuppressWarnings ("unchecked" )
57+ @ SuppressWarnings ({ "unchecked" , "UnusedParameters" } )
6058 public static <E > Matcher <Collection <E >> emptyCollectionOf (Class <E > unusedToForceReturnType ) {
6159 return (Matcher )empty ();
6260 }
@@ -77,22 +75,6 @@ public static <E> Matcher<Iterable<? extends E>> contains(E... items) {
7775 return contains (Wrapping .asEqualToMatchers (items ));
7876 }
7977
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-
9678 /**
9779 * Creates a matcher for {@link Iterable}s that matches when a single pass over the
9880 * examined {@link Iterable} yields a series of items, each satisfying the corresponding
0 commit comments