Here you can find the source of equalLists(List> first, List> second)
public static boolean equalLists(List<?> first, List<?> second)
//package com.java2s; /*/* ww w . j a v a 2s. c om*/ * Fernflower - The Analytical Java Decompiler * http://www.reversed-java.com * * (C) 2008 - 2010, Stiver * * This software is NEITHER public domain NOR free software * as per GNU License. See license.txt for more details. * * This software is distributed WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. */ import java.util.List; public class Main { public static boolean equalLists(List<?> first, List<?> second) { if (first == null) { return second == null; } else if (second == null) { return first == null; } if (first.size() == second.size()) { for (int i = 0; i < first.size(); i++) { if (!equalObjects(first.get(i), second.get(i))) { return false; } } return true; } return false; } public static boolean equalObjects(Object first, Object second) { return first == null ? second == null : first.equals(second); } }