public JSON merge(JSON json) {
    for (Map.Entry<String, Object> entry : json.entrySet()) {
      String key = entry.getKey();
      Object o = entry.getValue();
      if ( o instanceof JSON ) {
	Object target = get(key);
	if ( target instanceof JSON ) {
	  ((JSON) target).merge((JSON) o);
	}
	else {
	  o = new JSON((JSON) o);
	  super.put(key, o);
	}
      }
      else if ( o instanceof JSONArray ) {
	Object target = get(key);
	if ( target instanceof JSONArray ) {
	  ((JSONArray) target).addAll((JSONArray) o);
	}
	else {
	  o = new JSONArray((JSONArray) o);
	  super.put(key, o);
	}
      }
      else {
	super.put(key, o);
      }
    }
    return this;
  }