Iteration order of HashSet/Map changes between JRE 7 and JRE 8, breaking tests. Switch to LinkedHashSet/Map.