class GroovyMultimap
{ Map map = [:] public boolean put(Object key, Integer value) { List list = map.get(key, []) list.add(value) map."$key" = list } public String toString() { return map.toMapString() } public List get(Object key) { return map.get(key,null) } public Integer get_min(Object key) { def r=map.get(key,null) if (r!=null) { return r.min(); } else { return null; } }}def a=new GroovyMultimap()a.put("1",1)a.put("1",2)println a.get_min("2")[].min()