@Test(expected = AssertionError.class) public void listNotEqualSortedAndContainsNewItems() throws Exception { List<Integer> actual = asList(1, 2, 3, 4); List<Integer> expected = asList(3, 2, 1); 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);  }