@SuppressWarnings({"unchecked", "rawtypes"})
    public <T> T getObject(int index, Type type, JSONReader.Feature... features) {
        Object value = get(index);

        if (value == null) {
            return null;
        }

        Class<?> valueClass = value.getClass();
        ObjectReaderProvider provider = JSONFactory.getDefaultObjectReaderProvider();
        Function typeConvert = provider.getTypeConvert(valueClass, type);

        if (typeConvert != null) {
            return (T) typeConvert.apply(value);
        }

        boolean fieldBased = false;
        long featuresValue = JSONFactory.defaultReaderFeatures;
        for (JSONReader.Feature feature : features) {
            featuresValue |= feature.mask;
            if (feature == JSONReader.Feature.FieldBased) {
                fieldBased = true;
            }
        }

        if (value instanceof Map) {
            ObjectReader<T> objectReader = provider.getObjectReader(type, fieldBased);
            return objectReader.createInstance((Map) value, featuresValue);
        }

        if (value instanceof Collection) {
            ObjectReader<T> objectReader = provider.getObjectReader(type, fieldBased);
            return objectReader.createInstance((Collection) value, featuresValue);
        }

        Class clazz = TypeUtils.getMapping(type);
        if (clazz.isInstance(value)) {
            return (T) value;
        }

        String json = JSON.toJSONString(value);
        JSONReader jsonReader = JSONReader.of(json);
        jsonReader.context.config(features);

        ObjectReader objectReader = provider.getObjectReader(clazz, fieldBased);
        return (T) objectReader.readObject(jsonReader, null, null, 0);
    }
Returns the result of the {@link Type} converter conversion of the element at the specified position in this {@link JSONArray}.

<pre>{@code
JSONArray array = ...
User user = array.getObject(0, TypeReference<HashMap<String ,User>>(){}.getType());
}</pre>

@param index index of the element to return
@param type specify the {@link Type} to be converted
@return {@code <T>} or null
@throws JSONException If no suitable conversion method is found
@throws IndexOutOfBoundsException if the index is out of range {@code (index < 0 || index >= size())}
core/src/main/java/com/alibaba/fastjson2/JSONArray.java