Here you can find the source of equalCollection(Collection c1, Collection c2)
@SuppressWarnings({ "rawtypes", "unchecked" }) public static boolean equalCollection(Collection c1, Collection c2)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { @SuppressWarnings({ "rawtypes", "unchecked" }) public static boolean equalCollection(Collection c1, Collection c2) { return c1.containsAll(c2) && c2.containsAll(c1); }//w w w.j a v a 2s .co m }