@Test public void collectionsEquals() throws Exception { List<String> actual = Arrays.asList("1", "2", "3"); List<String> expected = Arrays.asList("1", "2", "3"); assertThat(actual, hasSameItemsAsCollection(expected)); }
@Factory public static <T> Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList) { return new HasSameItemsAsCollectionMatcher<>(correctList); }
HasSameItemsAsCollectionMatcher extends TypeSafeDiagnosingMatcher<Collection<? extends T>> { @Factory public static <T> Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList) { return new HasSameItemsAsCollectionMatcher<>(correctList); } }
HasSameItemsAsCollectionMatcher extends TypeSafeDiagnosingMatcher<Collection<? extends T>> { @Factory public static <T> Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList) { return new HasSameItemsAsCollectionMatcher<>(correctList); } HasSameItemsAsCollectionMatcher(Collection<? extends T> expected); }
HasSameItemsAsCollectionMatcher extends TypeSafeDiagnosingMatcher<Collection<? extends T>> { @Factory public static <T> Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList) { return new HasSameItemsAsCollectionMatcher<>(correctList); } HasSameItemsAsCollectionMatcher(Collection<? extends T> expected); @Override void describeTo(Description description); @Factory static Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList); }
HasSameItemsAsCollectionMatcher extends TypeSafeDiagnosingMatcher<Collection<? extends T>> { @Factory public static <T> Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList) { return new HasSameItemsAsCollectionMatcher<>(correctList); } HasSameItemsAsCollectionMatcher(Collection<? extends T> expected); @Override void describeTo(Description description); @Factory static Matcher<Collection<? extends T>> hasSameItemsAsCollection(Collection<? extends T> correctList);  }