title: Gson JsonObject copy value affected others JsonObject instance
body: <p>I have weird problem with gson (my gson version is 2.3.1)
  I have JsonObject instance called jsonObject (JsonObject jsonObject)
  jsonObject has value, not empty
  And I create another one, JsonObject tempOject = jsonObject;
  So, when I try to remove element inside tempObject, lets say,
  tempObject.remove("children");</p>
  
  <p>Then that code affected the jsonObject instance.</p>
  
  <p>Here is the code snippet :</p>
  
  <pre><code>jsonObject              = element.getAsJsonObject();
          JsonElement tempElement = element;
          JsonObject tempObject   = jsonObject;
          String tempJson;
  
          if(tempObject.has("children")){
              tempObject.remove("children");
              tempJson = tempObject.toString();
              tempElement = new JsonParser().parse(tempJson);
          }
  
          if(nodes.isEmpty()){
              elements = new ArrayList&lt;&gt;();
              nodes.put(iterator, elements);
          }
          if(!nodes.containsKey(iterator)){
              elements = new ArrayList&lt;&gt;();
              nodes.put(iterator, elements);
          }
          nodes.get(iterator).add(tempElement);
  
          if (jsonObject.has("children")){
              tempNextJson        = jsonObject.get("children").toString();
              tempCurrJson        = jsonObject.toString();
  
              tempIterator++;
              metaDataProcessor(tempNextJson, tempCurrJson, tempNextJson, tempIterator, maxLevel);
          }
  </code></pre>
  
  <p>I have read the gson JsonObject class, it use deep copy method. That was not supposed to affected the reference since JsonObject using deep value copy, so the returned JsonObject object is the new one.</p>
  
  <p>But why this is happened?</p>
  
  <p>Anyway...there is deepCopy method inside JsonObject class</p>
  
  <pre><code>JsonObject deepCopy() {
      JsonObject result = new JsonObject();
      Iterator i$ = this.members.entrySet().iterator();
  
      while(i$.hasNext()) {
          Entry entry = (Entry)i$.next();
          result.add((String)entry.getKey(), ((JsonElement)entry.getValue()).deepCopy());
      }
  
      return result;
  }
  </code></pre>
  
  <p>But thats an abstract method from JsonElement class which implemented on JsonObject, and the attribute not set as public, so I cannot call that method. But I guess that method supposedly called directly when I do instance copy.</p>
  
  <p>How about that?</p>
  
  <p>Thanks in advance</p>