See if two ArrayLists are the same. They are considered the same if their elements are all equal, according to
the "equals" method. This method can be used to overcome an incompatibility between Java and C# in the equals
method for lists; Java checks for "deep" equality (like this method) while C# normally just checks if the lists
reference the same object. Using this method instead provides deep equality semantics for both.
list1 - 1st ArrayList
list2 - 2nd ArrayList
true if the lists are equal, checking member by member equality, and false if not
public static int arrayListHashCode(ArrayList<?> list)
Get the "deep" hash code for an ArrayList, by combining hash codes of elements in the list. This method can be
used to overcome an incompatibility between Java and C# in the hashCode method for lists; Java checks for "deep"
hash code (like this method) while C# normally just checks computes hash code based on object identity. Using
this method instead provides deep hash code semantics for both. If you use this, you'll also want to use
arrayListsEqual for equality, as the semantics of equality / hashCode have to go together (rule being if two
objects equal, they MUST have the same hash code, which is true for both Java & C#).
Return a list of all distinct elements in the list, removing any duplicates. Returned items are in the same
order as in the original list. Note that the input list shouldn't contain any nulls--results are undefined if