public class SequenceMatcher<T> extends ListMatcher<T>
matcherseach match against an item that the previous matcher matched against. That means the second matcher should match an item that follow the item that the first matcher matched. If the number of items is larger than the number of matchers, the excess items are not evaluated. Use
Matchers.exactSequenceOf(org.hamcrest.Matcher)to match the sequence exactly. If the last item of the list has been evaluated, and Matchers still remain, they are evaluated against a
|Constructor and Description|
Construct a matcher that will return true if all the given
|Modifier and Type||Method and Description|
Describes the type of collection expected.
Evaluates the matcher for argument
describeTo, failedMatcherMessage, getLastSeparator, getMatchers, matches, matchRemainder, reportFailed
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
@SafeVarargs public SequenceMatcher(org.hamcrest.Matcher<? super T>... matchers)
matchersmatch against an item positioned after the item that the previous matcher matched against.
matchers- The matchers that must match against at least one item in the list.
item. The item has been verified to be a list, but the exact type of contents of a list cannot be verified, due to Erasure of Generic Types.
protected void describeCollectionType(org.hamcrest.Description description)
Copyright © 2010–2020. All rights reserved.