public static boolean isEqualCollection(final Collection a, final Collection b) {
        if (a.size() != b.size()) {
            return false;
        } else {
            Map mapa = getCardinalityMap(a);
            Map mapb = getCardinalityMap(b);
            if (mapa.size() != mapb.size()) {
                return false;
            } else {
                Iterator it = mapa.keySet().iterator();
                while (it.hasNext()) {
                    Object obj = it.next();
                    if (getFreq(obj, mapa) != getFreq(obj, mapb)) {
                        return false;
                    }
                }
                return true;
            }
        }
    }
@Test
    void testIsEqualCollection() {
        List<String> list1 = Arrays.asList("2", "2", "3");
        List<String> list2 = Arrays.asList("3", "2", "2");
        List<String> list3 = Arrays.asList("3", "2", "3");
        List<String> list4 = Arrays.asList("3", "2");
        assertTrue(CollectionUtils.isEqualCollection(list1, list2));
        assertFalse(CollectionUtils.isEqualCollection(list1, list3));
        assertFalse(CollectionUtils.isEqualCollection(list1, list4));
        List<String> list5 = Arrays.asList("3", "2", "1");
        assertFalse(CollectionUtils.isEqualCollection(list1, list5));
        List<String> list6 = Arrays.asList("2", "2", "1");
        assertFalse(CollectionUtils.isEqualCollection(list1, list6));
    }