|
1 | 1 | package org.hamcrest.collection; |
2 | 2 |
|
3 | | -import org.hamcrest.Description; |
4 | | -import org.hamcrest.Factory; |
5 | | -import org.hamcrest.Matcher; |
6 | | -import org.hamcrest.TypeSafeDiagnosingMatcher; |
7 | | - |
8 | 3 | import java.util.ArrayList; |
9 | 4 | import java.util.Arrays; |
10 | 5 | import java.util.Collection; |
11 | 6 | import java.util.List; |
12 | 7 |
|
13 | | -import static java.util.Arrays.asList; |
| 8 | +import org.hamcrest.Description; |
| 9 | +import org.hamcrest.Factory; |
| 10 | +import org.hamcrest.Matcher; |
| 11 | +import org.hamcrest.TypeSafeDiagnosingMatcher; |
| 12 | + |
14 | 13 | import static org.hamcrest.core.IsEqual.equalTo; |
15 | 14 |
|
16 | 15 | public class IsIterableContainingInAnyOrder<T> extends TypeSafeDiagnosingMatcher<Iterable<? extends T>> { |
@@ -80,28 +79,6 @@ private boolean isMatched(S item) { |
80 | 79 | mismatchDescription.appendText("Not matched: ").appendValue(item); |
81 | 80 | return false; |
82 | 81 | } |
83 | | - |
84 | | - } |
85 | | - |
86 | | - /** |
87 | | - * Creates a matcher for {@link Iterable}s that matches when a single pass over the |
88 | | - * examined {@link Iterable} yields a single item that satisfies the specified matcher. |
89 | | - * For a positive match, the examined iterable must only yield one item. |
90 | | - * <p/> |
91 | | - * For example: |
92 | | - * <pre>assertThat(Arrays.asList("foo"), containsInAnyOrder(equalTo("foo")))</pre> |
93 | | - * |
94 | | - * @deprecated use contains(Matcher<? super E> itemMatcher) instead |
95 | | - * |
96 | | - * @param itemMatcher |
97 | | - * the matcher that must be satisfied by the single item provided by an |
98 | | - * examined {@link Iterable} |
99 | | - */ |
100 | | - @SuppressWarnings("unchecked") |
101 | | - @Deprecated |
102 | | - @Factory |
103 | | - public static <E> Matcher<Iterable<? extends E>> containsInAnyOrder(final Matcher<? super E> itemMatcher) { |
104 | | - return containsInAnyOrder(new ArrayList<Matcher<? super E>>(asList(itemMatcher))); |
105 | 82 | } |
106 | 83 |
|
107 | 84 | /** |
|
0 commit comments