public <T> List<T> toJavaList(Class<T> clazz) {
        List<T> list = new ArrayList<>(this.size());

        ObjectReaderProvider provider = JSONFactory.getDefaultObjectReaderProvider();
        ObjectReader objectReader = provider.getObjectReader(clazz);

        for (Object item : this) {
            T classItem;
            if (item instanceof Map) {
                classItem = (T) objectReader.createInstance((Map) item, JSONReader.Feature.SupportSmartMatch.mask);
            } else {
                if (item == null || item.getClass() == clazz) {
                    list.add((T) item);
                    continue;
                }

                Function typeConvert = provider.getTypeConvert(item.getClass(), clazz);
                if (typeConvert != null) {
                    Object converted = typeConvert.apply(item);
                    list.add((T) converted);
                    continue;
                }
                // item is NOT null here
                throw new com.alibaba.fastjson2.JSONException(item.getClass() + " cannot be converted to " + clazz);
            }
            list.add(classItem);
        }

        return list;
    }
Returns a byte value at the specified location in this {@link com.alibaba.fastjson2.JSONArray}.

@param index index of the element to return
@return byte
@throws NumberFormatException If the value of get is {@link String} and it contains no parsable byte
@throws JSONException Unsupported type conversion to byte value
@throws IndexOutOfBoundsException if the index is out of range {@code (index < 0 || index >= size())}
fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSONArray.java