public BigInteger getBigInteger(int index) {
        Object value = get(index);

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

        if (value instanceof Number) {
            if (value instanceof BigInteger) {
                return (BigInteger) value;
            }

            if (value instanceof BigDecimal) {
                return ((BigDecimal) value).toBigInteger();
            }

            long longValue = ((Number) value).longValue();
            return BigInteger.valueOf(longValue);
        }

        if (value instanceof String) {
            String str = (String) value;

            if (str.isEmpty() || "null".equalsIgnoreCase(str)) {
                return null;
            }

            return new BigInteger(str);
        }

        if (value instanceof Boolean) {
            return (boolean) value ? BigInteger.ONE : BigInteger.ZERO;
        }

        throw new JSONException("Can not cast '" + value.getClass() + "' to BigInteger");
    }
Returns the {@link BigInteger} at the specified location in this {@link JSONArray}.

@param index index of the element to return
@return {@link BigInteger} or null
@throws IndexOutOfBoundsException if the index is out of range {@code (index < 0 || index >= size())}
@throws JSONException Unsupported type conversion to {@link BigInteger}
@throws NumberFormatException If the value of get is {@link String} and it is not a valid representation of {@link BigInteger}
core/src/main/java/com/alibaba/fastjson2/JSONArray.java