. . :
def map1 = [:].withDefault { 0 }
TreeMap map2 = map1
map1 groovy.lang.MapWithDefault map2 java.util.TreeMap. , , . map2 , . :
def map1 = [:].withDefault { 0 }
TreeMap map2 = new TreeMap(map1)
, . .
:
TreeMap<String, List<Data>> myData = (TreeMap<String, List<Data>>) [:].withDefault { [] }
:
def tmpMap = [:].withDefault { [] }
TreeMap<String, List<Data>> myData = (TreeMap<String, List<Data>>)tmpMap
, .
EDIT:
- - :
Set names = new HashSet()
ArrayList namesList = names
ArrayList, , ArrayList namesList = new ArrayList(names). , , , . , Groovy . ArrayList. TreeMap<String, List<Data>>.