title: Concatenation of JSON Arrays/Objects using Groovy
body: <p>How can two independent different JSON Arrays or JSON Objects be merged or concatenated and treated as a single JSON Object using Java or Groovy.</p>
  
  <p>See below sample JSON independent Objects i have
  First one holds Duties information</p>
  
  <pre><code>[
    {
      "code": "A0001",
      "description": "Do strategic planning for long range goals of the university"
    },
    {
      "code": "A0002",
      "description": "Administer budgets in excess of 1,000,000"
    }]
  </code></pre>
  
  <p>Second JSON object holds Certificates infomation</p>
  
  <pre><code> [
    {
      "code": "CPA",
      "description": "Certified Public Accountant"
    },
    {
      "code": "CPR",
      "description": "Cardiopulmonary Resuscitation"
    },
    {
      "code": "ELE",
      "description": "Electrician's License"
    }]
  </code></pre>
  
  <p>I need to concatenate and access both the JSONs in below format `</p>
  
  <pre><code>{
    "duties":
    [{
      "code": "A0001",
      "description": "Do strategic planning for long range goals of the university"
    },
    {
      "code": "A0002",
      "description": "Administer budgets in excess of 1,000,000"
    }],
    "Certificates":
    [
    {
      "code": "CPA",
      "description": "Certified Public Accountant"
    },
    {
      "code": "CPR",
      "description": "Cardiopulmonary Resuscitation"
    },
    {
      "code": "ELE",
      "description": "Electrician's License"
    }
    ]
    }
  </code></pre>
  
  <p>Please let me know the option available to get this done. Thanks</p>