title: How to group data object to JSon using java
body: <p>How should I create algorithm on creation of following JSON pattern using Java ?</p>
  
  <p>Target JSON pattern is as follows</p>
  
  <pre><code>      {
  "title":"ABC",
  "children":[{
      "title":"ABC_SUK",
      "children":[{
          "title":"ABC_SUK_Block_01",
          "children":[{
              "title":"XXX_201",
          },{
              "title":"XXX_202",  
          }]
      },{
          "title":"ABC_SUK_Block_02",
          "children":[{
              "title":"XXX_203",
          },{
              "title":"XXX_204",  
          }]
      }]
       }]
   }
  </code></pre>
  
  <p>From following table</p>
  
  <pre><code>            group | site   | block           |hostname
             _________________________________________
             ABC   | ABC_suk | ABC_SUK_Block_01|XXX_201
             ABC   | ABC_suk | ABC_SUK_Block_01|XXX_202
             ABC   | ABC_suk | ABC_SUK_Block_02|XXX_203
             ABC   | ABC_suk | ABC_SUK_Block_02|XXX_204
  </code></pre>
  
  <p>I am adding 1 object 1 row to <code>ArrayList&lt;Object&gt;</code></p>