nit: always LinkedHashSet and LinkedHashMap. Never straight HashSet or HashMap. The performance cost is negligible and the predictability is worth it.