Well the values() method of HashMap does not guarantee any specific ordering of its elements in the same way HashMap<> does not guarantee any specific ordering of its key-value pairs.
Try printing both values() functions and you shall see this in action yourself.