The short answer is that you're removing the field, then adding it back, so it appears at the end of the map (Groovy's map implementation uses LinkedHashMap under the covers, so the order of insertion is preserved).