Sorted maps in groovy
问题 I am interested in using a sorted map in groovy (with gremlin which is a DSL for graph databases). I have looked at this blog post on sorted maps here, but I am still a bit confused. How are sorted maps declared? Is it any different from the standard way for maps y = [:] ? When using a sorted map, are items inserted into the list going to be in the order they are inserted? Or will I have to run sort{} before the items in the sorted map are sorted? 回答1: If you just declare a map like so: def m