private void addChildren(JsonElement fromElement, JsonElement toElement) {

    if (fromElement instanceof JsonObject && toElement instanceof JsonObject) {

      JsonObject fromObject = (JsonObject) fromElement;
      JsonObject toObject = (JsonObject) toElement;

      for (Entry<String, JsonElement> entry : fromObject.entrySet()) {
        toObject.add(entry.getKey(), entry.getValue());
      }

    } else if (fromElement instanceof JsonArray && toElement instanceof JsonArray) {

      JsonArray fromArray = (JsonArray) fromElement;
      JsonArray toArray = (JsonArray) toElement;

      toArray.addAll(fromArray);
    }
  }