9 String9 8 String8 7 String7 10 String10 6 String6 ... ... how it is possible to fix? LinkedHashMap makes correct output order. but task wants HasMap to be displayed which is always mixed.