Groovy用inject方法构造Map

def a = [1, 2, 3]   
def b = [4, 5, 6]   
  
def m = [:]   
[a, b].transpose().each { k, v -> m += [(k): v] }   
assert m == [1: 4, 2: 5, 3: 6]  

编程技巧