I have some code utilizing standard Java collections: arrays, ArrayDeques, HashMaps, Lists, HashSets. My code is expected to be deterministic: the hash codes of all the elem
If you need a stable ordered HashSet, then you should be using LinkedHashSet per the javadoc,
Hash table and linked list implementation of the Set interface, with predictable iteration order
And per the HashSet javadoc,
... makes no guarantees as to the iteration order of the set