Here you can find the source of equals(List
public static <T> boolean equals(List<T> list1, List<T> list2)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static <T> boolean equals(List<T> list1, List<T> list2) { if (list1 == null && list2 == null) { return true; }/*from w w w .j a v a 2s .c o m*/ if (list1 == null || list2 == null) { return false; } for (int i = 0; i < list1.size(); i++) { if (!list1.get(i).equals(list2.get(i))) { return false; } } return true; } }