### Question:
CollectionUtil { public static boolean sameContent(final Collection<?> c1, final Collection<?> c2) { if (c1 == c2 || isEmpty(c2) && isEmpty(c1)) { return true; } boolean same = false; if (c1 != null && c2 != null) { same = c1.size() == c2.size(); if (same) { same = c1.equals(c2); } } return same; } private  CollectionUtil(); static boolean isEmpty(final Collection<?> col); static boolean isNotEmpty(final Collection<?> col); static boolean hasOneItem(final Collection<?> col); static boolean isNotEmpty(final Object[] array); static int size(final Collection<?> col); static boolean contains(final Collection<?> collection, final Object item); static boolean containsAny(final Collection<?> collection, final Object... items); static boolean noneEmpty(final Collection<?>... collections); static boolean sameContent(final Collection<?> c1, final Collection<?> c2);  }### Answer:
@Test public void testSameContent() { assertTrue("null null", CollectionUtil.sameContent(null, null)); final HashSet<Integer> col = new HashSet<>(); assertTrue("empty null", CollectionUtil.sameContent(col, null)); assertTrue("null empty", CollectionUtil.sameContent(null, col)); assertTrue("same", CollectionUtil.sameContent(col, col)); final HashSet<Integer> col1 = new HashSet<>(); col.add(1); assertFalse("not same empty 1", CollectionUtil.sameContent(col, col1)); assertFalse("not same 1 empty", CollectionUtil.sameContent(col1, col)); col1.add(1); assertTrue("same 1 1", CollectionUtil.sameContent(col1, col)); col1.add(2); assertFalse("same 1 2", CollectionUtil.sameContent(col1, col)); assertFalse("same 1 2", CollectionUtil.sameContent(null, col)); assertFalse("same 1 2", CollectionUtil.sameContent(col1, null)); }