Here you can find the source of equalLists(List list1, List list2)
@SuppressWarnings("unchecked") public static boolean equalLists(List list1, List list2)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { @SuppressWarnings("unchecked") public static boolean equalLists(List list1, List list2) { if (list1.size() != list2.size()) { return false; }//from www. j a v a 2 s . com List list2Clone = new ArrayList(list2); for (Object o : list1) { if (!list2Clone.contains(o)) { return false; } else { list2Clone.remove(o); } } return (list2Clone.isEmpty()); } }