title: Merge (Concat) Multiple JSONObjects in Java
body: <p>I am consuming some JSON from two different sources, I end up with two <code>JSONObject</code>s and I'd like to combine them into one. </p>
  
  <p>Data:</p>
  
  <pre><code>"Object1": {
      "Stringkey":"StringVal",
      "ArrayKey": [Data0, Data1]
  }
  
  "Object2": {
      "Stringkey":"StringVal",
      "Stringkey":"StringVal",
      "Stringkey":"StringVal",
  }
  </code></pre>
  
  <p>Code, using <a href="http://json.org/java/" rel="noreferrer">http://json.org/java/</a> library:</p>
  
  <pre><code>// jso1 and jso2 are some JSONObjects already instantiated
  JSONObject Obj1 = (JSONObject) jso.get("Object1");
  JSONObject Obj2 = (JSONObject) jso.get("Object2");
  </code></pre>
  
  <p>So in this situation I'd like to combine <code>Obj1</code> and <code>Obj2</code>, either to make a totally new <code>JSONObject</code> or concat one to the other. Any ideas besides pulling them all apart and individually adding in by <code>put</code>s?</p>