title: What would be a cleaner way to cluster ArrayList() based on one column data?
body: <p>Say I have a below list</p>
  
  <pre><code> full_list
  
   ID     NAME
   1      Apple
   1      Banana
   2      Carrot
   1      Mango
   2      Spinach
   3      BMW
   3      Opal
  </code></pre>
  
  <p>With this single list, I want to create a grouped list based on column <code>ID</code> like below</p>
  
  <pre><code> fruits_list              veggies_list               cars_list
   ID      NAME             ID      NAME              ID     NAME
   1       Apple            2       Carrot            3      BMW
   1       Banana           2       Spinach           3      Opal
   1       Mango
  </code></pre>
  
  <p>I was trying to do it with <code>Arraylist&lt;ArrayList&lt;CustomObject&gt;&gt;</code>. But it is adding more complexity to the code. Am I doing it wrong? Is there any cleaner way to do this?</p>
  
  <p>PS: Data incoming is not fixed. I cannot define lists explicitly with conditions (i.e. if(id==1), if(id==2) etc). This shall be done dynamically based on incoming data.</p>