@@ -19,7 +19,7 @@ public IsIterableContainingInRelativeOrder(List<Matcher<? super E>> matchers) {
19
19
20
20
@ Override
21
21
protected boolean matchesSafely (Iterable <? extends E > iterable , Description mismatchDescription ) {
22
- MatchSeriesInRelativeOrder <E > matchSeriesInRelativeOrder = new MatchSeriesInRelativeOrder <E >(matchers , mismatchDescription );
22
+ MatchSeriesInRelativeOrder <E > matchSeriesInRelativeOrder = new MatchSeriesInRelativeOrder <>(matchers , mismatchDescription );
23
23
matchSeriesInRelativeOrder .processItems (iterable );
24
24
return matchSeriesInRelativeOrder .isFinished ();
25
25
}
@@ -77,8 +77,9 @@ public boolean isFinished() {
77
77
* @param items
78
78
* the items that must be contained within items provided by an examined {@link Iterable} in the same relative order
79
79
*/
80
+ @ SafeVarargs
80
81
public static <E > Matcher <Iterable <? extends E >> containsInRelativeOrder (E ... items ) {
81
- List <Matcher <? super E >> matchers = new ArrayList <Matcher <? super E > >();
82
+ List <Matcher <? super E >> matchers = new ArrayList <>();
82
83
for (E item : items ) {
83
84
matchers .add (equalTo (item ));
84
85
}
@@ -96,6 +97,7 @@ public static <E> Matcher<Iterable<? extends E>> containsInRelativeOrder(E... it
96
97
* @param itemMatchers
97
98
* the matchers that must be satisfied by the items provided by an examined {@link Iterable} in the same relative order
98
99
*/
100
+ @ SafeVarargs
99
101
public static <E > Matcher <Iterable <? extends E >> containsInRelativeOrder (Matcher <? super E >... itemMatchers ) {
100
102
return containsInRelativeOrder (asList (itemMatchers ));
101
103
}
@@ -112,6 +114,6 @@ public static <E> Matcher<Iterable<? extends E>> containsInRelativeOrder(Matcher
112
114
* an examined {@link Iterable} in the same relative order
113
115
*/
114
116
public static <E > Matcher <Iterable <? extends E >> containsInRelativeOrder (List <Matcher <? super E >> itemMatchers ) {
115
- return new IsIterableContainingInRelativeOrder <E >(itemMatchers );
117
+ return new IsIterableContainingInRelativeOrder <>(itemMatchers );
116
118
}
117
119
}
0 commit comments