Groovy用inject方法构造Map 2015/12/14 16697 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]