Here you can find the source of equalsUnordered(Collection> collection1, Collection> collection2)
public static boolean equalsUnordered(Collection<?> collection1, Collection<?> collection2)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static boolean equalsUnordered(Collection<?> collection1, Collection<?> collection2) { return collection1 == collection2 || (collection1.size() == collection2.size() && collection1.containsAll(collection2)); }/* w w w . j a va2 s . co m*/ }