public class ListUtils extends Object
public static <T> boolean equals(List<T> list1, List<T> list2)
Lists based
on their content. Instead of using the List.equals(Object)
method, a proper comparison is made by looking at the equivalence of each
item. This equivalence is assessed by having the same item or by having
Object.equals(Object) returning true. As we compare List
s, the order of the items is checked too.List where two different items (a != b) are
equivalent (a.equals(b) == true) is considered as equals to the same list
where we swap these two items.list1 - list2 - true if both list have equals elements in the same
order, false otherwiseCopyright © 2014–2015. All rights reserved.