There is no reason to use a HashMap in the test, which makes checking the result harder. So, instead just use a LinkedHashMap so the result is always the same.