CollectionUtil { public static boolean equalContentsIgnoreOrder(Collection<?> c1, Collection<?> c2) { return c1.size() == c2.size() && c1.containsAll(c2); }  static String mkString(Collection<?> collection, String sep); static String mkString(Collection<T> collection, String start, String sep, String end); static boolean equalContentsIgnoreOrder(Collection<?> c1, Collection<?> c2); static Set<T> symmetricDifference(Collection<? extends T> c1, Collection<? extends T> c2); static Collection<T> filter(Collection<?> collection, Class<T> lowerBound); static T first(Collection<T> collection); static Optional<T> firstMatching(T[] array, Predicate<? super T> predicate);  }
@Test public void testEqualContentsIgnoreOrder() { List<Integer> l2Copy = new ArrayList<>(); l2Copy.addAll(l2); shuffle(); assertTrue(CollectionUtil.equalContentsIgnoreOrder( l2, l2Copy)); assertFalse(CollectionUtil.equalContentsIgnoreOrder( l1, l2)); }