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