Title say it all:
There is a slight ambiguity in the documentation as I understand it.
First the documentation speaks about insertion-ordered LinkedHashMap’s and notes that the iteration order is not affected upon inserting an item already mapped.
Then, it introduces access-ordered LinkedHashMap’s and insists on the fact that “merely a get is a structural modification”, i.e. it affects iteration order.
But, it is not clear whether the ”put()” of an existing item is a structural modification.
I expect the answer to be yes.
This simple piece of code should answer your question:
prints
Interpretation:
putunder an existing key, even with the same value, is a structural modification.