class DoubleToLong extends CastToLong<T, ToDouble<T>> {
            private DoubleToLong(ToDouble<T> tToDouble) {
                super(tToDouble);
            }

            @Override
            public long applyAsLong(T object) {
                return (long) inner.applyAsDouble(object);
            }
        }

        return new DoubleToLong(original);
    }


    /**
     * Returns an expression that wraps the specified expression and casts the
     * result from it into a {@code long}.
     *
     * @param original  the original expression
     * @param <T>       the input type
     * @return          the new {@link ToInt} expression
     */
    public static <T> ToLong<T> castBigDecimalToLong(ToBigDecimal<T> original) {<FILL_FUNCTION_BODY>

        class BigDecimalToLong extends CastToLong<T, ToBigDecimal<T>> {
            private BigDecimalToLong(ToBigDecimal<T> tToBigDecimal) {
                super(tToBigDecimal);
            }

            @Override
            public long applyAsLong(T object) {
                return inner.apply(object).longValueExact();
            }
        }

        return new BigDecimalToLong(original);
    
<no_super_class>