@Test(expected = AssertionError.class) public void actualListHasNotLastItemTwice() throws Exception { List<String> actual = asList("1", "2", "2", "3"); List<String> expected = asList("1", "2", "3"); assertThat(actual, HasSameItemsAsListMatcher.hasSameItemsAsList(expected)); }
@Factory public static <T> HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList) { return new HasSameItemsAsListMatcher<>(correctList); }
HasSameItemsAsListMatcher extends TypeSafeDiagnosingMatcher<List<? extends T>> { @Factory public static <T> HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList) { return new HasSameItemsAsListMatcher<>(correctList); } }
HasSameItemsAsListMatcher extends TypeSafeDiagnosingMatcher<List<? extends T>> { @Factory public static <T> HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList) { return new HasSameItemsAsListMatcher<>(correctList); } HasSameItemsAsListMatcher(List<? extends T> expect); }
HasSameItemsAsListMatcher extends TypeSafeDiagnosingMatcher<List<? extends T>> { @Factory public static <T> HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList) { return new HasSameItemsAsListMatcher<>(correctList); } HasSameItemsAsListMatcher(List<? extends T> expect); HasSameItemsAsListMatcher<T> useWrapperFactory(WrapperFactory<T> wrapperFactory); HasSameItemsAsListMatcher<T> sameSorted(); @Override void describeTo(Description description); @Factory static HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList); }
HasSameItemsAsListMatcher extends TypeSafeDiagnosingMatcher<List<? extends T>> { @Factory public static <T> HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList) { return new HasSameItemsAsListMatcher<>(correctList); } HasSameItemsAsListMatcher(List<? extends T> expect); HasSameItemsAsListMatcher<T> useWrapperFactory(WrapperFactory<T> wrapperFactory); HasSameItemsAsListMatcher<T> sameSorted(); @Override void describeTo(Description description); @Factory static HasSameItemsAsListMatcher<T> hasSameItemsAsList(List<? extends T> correctList);  }