class ToBigInteger
        implements Function {
    @Override
    public Object apply(Object o) {<FILL_FUNCTION_BODY>}
}

        if (o == null || o instanceof BigInteger) {
            return o;
        }

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

        if (o instanceof Byte
                || o instanceof Short
                || o instanceof Integer
                || o instanceof Long
                || o instanceof AtomicInteger
                || o instanceof AtomicLong
                || o instanceof Float
                || o instanceof Double
        ) {
            return BigInteger.valueOf(((Number) o).longValue());
        }

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

        throw new JSONException("can not cast to BigInteger " + o.getClass());
    
<no_super_class>