I know how HashMap
works and that in the case of hash collisions it forms a Linked List in that bucket.
I get that in a LinkedHashMap
it maintains insertion order by the 'before' & 'after' fields but how would it maintain the insertion order if there are hash collisions like in a HashMap.
More specifically, the values in the array and any particular bucket could have been inserted at different time intervals, and at the time of retrieving them, wouldn't it be a mess?