Here you can find the source of equals(List c1, List c2)
public static boolean equals(List c1, List c2)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static boolean equals(List c1, List c2) { boolean bool = true; if (null != c1 && null != c2) { if (c1.size() != c2.size()) bool = false;/*from w w w.jav a 2s .co m*/ else for (int i = 0; i < c1.size(); i++) { if (!c1.get(i).getClass().equals(c2.get(i).getClass())) { bool = false; break; } else if (!c1.get(i).equals(c2.get(i))) { bool = false; break; } } } else { bool = false; } return bool; } }