title: How to create a list of objects by grouping them by a common name
body: <p>i have a list of ungrouped objects and i want to return a list of grouped objects by a common value</p>
  
  <pre><code>[{"name": "test", "group": "A"},{"name": "test2", "group": "B"},{"name": "test3", "group": "A"},{"name": "test4", "group": "B"}]
  </code></pre>
  
  <p>I want to return this</p>
  
  <pre><code>[{"group":"A","users":[{"name":"test"},{"name":"test3"}]}]
  </code></pre>