Here you can find the source of isEqual(java.util.List list1, java.util.List list2)
public static boolean isEqual(java.util.List list1, java.util.List list2)
//package com.java2s; //License from project: Apache License import java.util.ListIterator; public class Main { public static boolean isEqual(java.util.List list1, java.util.List list2) { ListIterator e1 = list1.listIterator(); ListIterator e2 = list2.listIterator(); while (e1.hasNext() && e2.hasNext()) { Object o1 = e1.next(); Object o2 = e2.next(); if (!(o1 == null ? o2 == null : o1.equals(o2))) return false; }//from w w w .j a v a 2 s. c o m return !(e1.hasNext() || e2.hasNext()); } }