Skip to content

Commit 38c7a68

Browse files
committed
Factory methods. Removed single matcher overload.
1 parent 0221ff1 commit 38c7a68

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

hamcrest-library/src/main/java/org/hamcrest/collection/MatchCollections.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
import org.hamcrest.Matcher;
44
import org.hamcrest.internal.Wrapping;
55

6-
import java.util.ArrayList;
76
import java.util.Collection;
87
import java.util.List;
98

10-
import static java.util.Arrays.asList;
119
import 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

Comments
 (0)