Did your instructor give you javadocs for their HashMap class which explains the novel behaviour? You can't even try out java.util.HashMap, LinkedHashMap or TreeMap because your instructor's HashMap has an incompatible interface: you'd have to edit your loop as well as the import statement. You could ask you instructor an innocent question about why it works like that. I think it wouldn't be inappropriate to point out a third party
:facepalm:
either. I wouldn't describe myself as a Java expert, so I'd be interested to know how many other keen Java programmers would also :facepalm: over this