Some test cases are failing in my application which depends upon the element insertion order . It used to work fine in Java 7 but this issue started after upgrading to Java 8. While searching internet I found this in an article:
Java 8 includes some possible changes to HashSet/Map iteration order:
Can some please suggest me - how can I iterate the objects in a Map in the same order as the insertion order into the Map, considering I would still be using Java 1.8 in my dev environment?
Yes of course it was never assured by HashMap that the objects can be retrieved in the same order , but yes it used to work in java 7.
Does LinkedHashMap
work to implement this ?