public int getSize(String key) {
        Object value = get(key);
        if (value instanceof Map) {
            return ((Map<?, ?>) value).size();
        }
        if (value instanceof Collection) {
            return ((Collection<?>) value).size();
        }
        return 0;
    }
if value instance of Map or Collection, return size, other return 0

@param key
@since 2.0.24
core/src/main/java/com/alibaba/fastjson2/JSONObject.java