but got an error on both
Everything I can find wants to sort on Key but as you can see there is no key, value type of format here. So I was thinking list too but it just errors out.
Basically as things happen that fit the criteria it writes to the list/map using the statement in the first post. I tried doing something with a key, value but just couldn't get it to work they way I wanted it to. Then I came across this way in Grail's Cookbook. A great reference for groovy examples.
An unexpected error has occurred trying to load the app. Check Logs for more information.
Error: No signature of method: java.lang.String.sort() is applicable for argument types: () values:  Possible solutions: drop(int), tr(java.lang.CharSequence, java.lang.CharSequence), wait(), split(), toSet(), next()