public static Map toMap(JSONObject json, String key) {
		if (null == json) {
			return null;
		}
		if (!StringUtils.isEmpty(key) && !json.has(key)) {
			return null;
		}
		Map jsonMap = new HashMap();
		JSONObject convertible = StringUtils.isEmpty(key) ? json
				: (JSONObject) json.get(key);
		Iterator keysIterator = convertible.keys();
		while (keysIterator.hasNext()) {
			String k = (String) keysIterator.next();
			Object v = convertible.get(k);
			jsonMap.put(k, v);
		}
		return jsonMap;
	}