public virtual void test_relativeTime()
        {
            double test1 = VOLS.relativeTime(VAL_DATE_TIME);

            assertEquals(test1, 0d);
            double test2 = VOLS.relativeTime(date(2018, 2, 17).atStartOfDay(LONDON_ZONE));
            double test3 = VOLS.relativeTime(date(2012, 2, 17).atStartOfDay(LONDON_ZONE));

            assertEquals(test2, -test3);     // consistency checked
        }
        //-------------------------------------------------------------------------
        public virtual void present_value_formula()
        {
            double                forward    = PRICER_SWAP.parRate(RSWAP_REC, MULTI_USD);
            double                pvbp       = PRICER_SWAP.LegPricer.pvbp(RSWAP_REC.getLegs(SwapLegType.FIXED).get(0), MULTI_USD);
            double                volatility = NORMAL_VOLS_USD_STD.volatility(SWAPTION_LONG_REC.Expiry, SWAP_TENOR_YEAR, STRIKE, forward);
            NormalFunctionData    normalData = NormalFunctionData.of(forward, Math.Abs(pvbp), volatility);
            double                expiry     = NORMAL_VOLS_USD_STD.relativeTime(SWAPTION_LONG_REC.Expiry);
            EuropeanVanillaOption option     = EuropeanVanillaOption.of(STRIKE, expiry, PutCall.PUT);
            double                pvExpected = NORMAL.getPriceFunction(option).apply(normalData);
            CurrencyAmount        pvComputed = PRICER_SWAPTION_NORMAL.presentValue(SWAPTION_LONG_REC, MULTI_USD, NORMAL_VOLS_USD_STD);

            assertEquals(pvComputed.Currency, USD);
            assertEquals(pvComputed.Amount, pvExpected, TOLERANCE_PV);
        }
        //-------------------------------------------------------------------------
        public virtual void test_presentValue()
        {
            CurrencyAmount        pvRecComputed = PRICER_SWAPTION.presentValue(SWAPTION_REC_LONG, RATE_PROVIDER, VOLS);
            CurrencyAmount        pvPayComputed = PRICER_SWAPTION.presentValue(SWAPTION_PAY_SHORT, RATE_PROVIDER, VOLS);
            double                forward       = PRICER_SWAP.parRate(RSWAP_REC, RATE_PROVIDER);
            double                annuityCash   = PRICER_SWAP.LegPricer.annuityCash(RSWAP_REC.getLegs(SwapLegType.FIXED).get(0), forward);
            double                volatility    = VOLS.volatility(SWAPTION_REC_LONG.Expiry, SWAP_TENOR_YEAR, STRIKE, forward);
            double                discount      = RATE_PROVIDER.discountFactor(USD, SETTLE_DATE);
            NormalFunctionData    normalData    = NormalFunctionData.of(forward, annuityCash * discount, volatility);
            double                expiry        = VOLS.relativeTime(SWAPTION_REC_LONG.Expiry);
            EuropeanVanillaOption optionRec     = EuropeanVanillaOption.of(STRIKE, expiry, PutCall.PUT);
            EuropeanVanillaOption optionPay     = EuropeanVanillaOption.of(STRIKE, expiry, PutCall.CALL);
            double                pvRecExpected = NORMAL.getPriceFunction(optionRec).apply(normalData);
            double                pvPayExpected = -NORMAL.getPriceFunction(optionPay).apply(normalData);

            assertEquals(pvRecComputed.Currency, USD);
            assertEquals(pvRecComputed.Amount, pvRecExpected, NOTIONAL * TOL);
            assertEquals(pvPayComputed.Currency, USD);
            assertEquals(pvPayComputed.Amount, pvPayExpected, NOTIONAL * TOL);
        }