I have two maps in Groovy [a: 1, b: 2] and [b:1, c:3] and would like to create from them a third map [a: 1, b: 3, c: 3]. Is there a Gr
[a: 1, b: 2]
[b:1, c:3]
[a: 1, b: 3, c: 3]
def merge(map1, map2) { def add = { map, entry -> map << entry } map2.inject(map1.inject([:], add), add) }