Group By in Groovy
<p>I have a list of object as follows</p>

<pre><code>[["GX 470","Model"],["Lexus","Make"],["Jeep","Make"],["Red","Color"],["blue","Color"]]
</code></pre>

<p>and I want to transform it to </p>

<pre><code>{"Model":["GX 470"],"Make":["Lexus","Jeep"],"Color":["Red", "blue"]}
</code></pre>

<p>I tried </p>

<pre><code>list.groupBy{ it[1] }
</code></pre>

<p>But that returns me</p>

<pre><code>{"Model":[["GX 470","Model"]],"Make":[["Lexus","Make"],["Jeep","Make"]],"Color":[["Red","Color"],["blue","Color"]]}
</code></pre>