public class HasSubsequenceMatcher<T> extends org.hamcrest.TypeSafeDiagnosingMatcher<List<T>>
assertThat( [1,2,3,4,5,6], hasSubsequenceOf([2,3,4]) )
assertThat( [1,2,3,4,5,6], hasSubsequenceOf([6]) )
assertThat( [1,2,3,4,5,6], hasSubsequenceOf([])
assertThat( [1,2,1,2,3,3], hasSubsequenceOf([1,2,3])
<p>
assertThat( [1,2,3,4,5,6], not(hasSubsequenceOf([1,2,6])) )
assertThat( [1,2,3,4,5,6], not(hasSubsequenceOf([1,1])) )
Modifier and Type | Method and Description |
---|---|
void |
describeTo(org.hamcrest.Description description) |
static <U> org.hamcrest.Matcher<List<U>> |
hasSubsequence(List<U> items) |
static <U> org.hamcrest.Matcher<List<U>> |
hasSubsequenceOf(U... items) |
protected boolean |
matchesSafely(List<T> items,
org.hamcrest.Description mismatchDescription) |
protected boolean matchesSafely(List<T> items, org.hamcrest.Description mismatchDescription)
public void describeTo(org.hamcrest.Description description)
@SafeVarargs public static <U> org.hamcrest.Matcher<List<U>> hasSubsequenceOf(U... items)
Copyright © 2002-2019 Atlassian. All Rights Reserved.