Here you can find the source of equalsEmptyEqNull(List
public static <T> boolean equalsEmptyEqNull(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 equalsEmptyEqNull(List<T> list1, List<T> list2) { if ((list1 == null || list1.isEmpty()) && (list2 == null || list2.isEmpty())) { return true; }/*from ww w . j a va 2s . c om*/ 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; } public static <T> boolean equals(List<T> list1, List<T> list2) { if (list1 == null && list2 == null) { return true; } 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; } }