If I understand it correctly, ArrayMap innards are sorted in order to have deterministic ordering of its elements.
If that's true, then there is an error. ArrayMap#Cmp comparator compares string representation of objects if they are not Comparable. String representation is not a deterministic function, because if Object#toString() is not overridden, then it is a function of Object#hashCode(), which is not deterministic by definition. Thus, ordering of ArrayMap is not deterministic if its contents are not Comparable and don't override Object#toString() in a deterministic manner.
If I understand it correctly,
ArrayMapinnards are sorted in order to have deterministic ordering of its elements.If that's true, then there is an error.
ArrayMap#Cmpcomparator compares string representation of objects if they are notComparable. String representation is not a deterministic function, because ifObject#toString()is not overridden, then it is a function ofObject#hashCode(), which is not deterministic by definition. Thus, ordering ofArrayMapis not deterministic if its contents are notComparableand don't overrideObject#toString()in a deterministic manner.