Here you can find the source of equalsSet(Collection c1, Collection c2)
public static boolean equalsSet(Collection c1, Collection c2)
//package com.java2s; import java.util.*; public class Main { public static boolean equalsSet(Collection c1, Collection c2) { boolean equals; if (c1 == null) { equals = (c2 == null);//from w w w . j a va 2 s . c o m } else if (c2 == null) { equals = false; } else if (c1.size() == c2.size()) { equals = true; Iterator iterC1 = c1.iterator(); while (equals && iterC1.hasNext()) { Object o1 = iterC1.next(); equals = c2.contains(o1); } } else { equals = false; } return equals; } }