CollectionUtils { public static boolean deepEquals(@NotNull final List<byte[]> a, @NotNull final List<byte[]> b) { if (a == b) { return true; } if (a.size() != b.size()) { return false; } for (int i = 0; i < a.size(); i++) { if (!Arrays.equals(a.get(i), b.get(i))) { return false; } } return true; } private  CollectionUtils(); @NotNull static List<R> listMap(@NotNull final List<T> input, @NotNull final Function<T, R> mapper); static boolean deepEquals(@NotNull final List<byte[]> a, @NotNull final List<byte[]> b);  }
@Test public void deepEquals_bothDistinctUnmodifiableArrayList() throws Exception { assertThat(CollectionUtils.deepEquals( unmodifiableList(newArrayList(b(1), b(2), b(3))), unmodifiableList(newArrayList(b(1), b(2), b(3))) )).isTrue(); }
@Test public void deepEquals_unmodifiableArrayListVsArrayList() throws Exception { assertThat(CollectionUtils.deepEquals( unmodifiableList(newArrayList(b(1), b(2), b(3))), newArrayList(b(1), b(2), b(3)) )).isTrue(); }
@Test public void deepEquals_arrayListVsUnmodifiableArrayList() throws Exception { assertThat(CollectionUtils.deepEquals( newArrayList(b(1), b(2), b(3)), unmodifiableList(newArrayList(b(1), b(2), b(3))) )).isTrue(); }
@Test public void deepEquals_arrayListVsArrayList() throws Exception { assertThat(CollectionUtils.deepEquals( newArrayList(b(1), b(2), b(3)), newArrayList(b(1), b(2), b(3)) )).isTrue(); }
@Test public void deepEquals_sameList() throws Exception { final ArrayList<byte[]> list = newArrayList(b(1), b(2), b(3)); assertThat(CollectionUtils.deepEquals( list, list )).isTrue(); }
@Test public void deepEquals_differentSizeLists() throws Exception { assertThat(CollectionUtils.deepEquals( newArrayList(b(1), b(2), b(3), b(4)), newArrayList(b(1), b(2), b(3)) )).isFalse(); }
@Test public void deepEquals_differentContents() throws Exception { assertThat(CollectionUtils.deepEquals( newArrayList(b(11), b(12), b(13)), newArrayList(b(1), b(2), b(3)) )).isFalse(); }