List of utility methods to do List Equal
boolean | isEqual(List is Equal return (getCommonElements(from, to).size() == from.size()) && (from.size() == to.size());
|
boolean | isEqualAsMultiset(List> left, List> right) Checks whether two given lists that are interpreted as multi-sets contain the same elements. for (Object e : left) { if (right.contains(e)) { right.remove(e); } else { return false; return right.isEmpty(); ... |
boolean | isEqualIgnoringOrder(List left, List right) is Equal Ignoring Order if (left != null && right != null) { ArrayList sortedLeft = new ArrayList(left); ArrayList sortedRight = new ArrayList(right); Collections.sort(sortedLeft); Collections.sort(sortedRight); return sortedLeft.toString().equals(sortedRight.toString()); } else { return left == right; ... |
boolean | isEqualList(List check equal without caring about the order. if (list1 == list2) { return true; if (list1 == null || list2 == null || list1.size() != list2.size()) { return false; for (T obj1 : list1) { if (!list2.contains(obj1)) { ... |
boolean | isEquals(List extends Object> l1, List extends Object> l2) is Equals if (l1 == l2) return true; if (l1 == null) return l2 == null; if (l2 == null) return false; if (l1.size() != l2.size()) return false; ... |
boolean | isEquals(List> l1, List> l2) is Equals if (l1 == null && l2 == null) { return true; if (l1 == null || l2 == null) { return false; if (l1.size() != l2.size()) { return false; ... |