//-------------------------------------------------------------------------
 public virtual void test_volatility()
 {
     for (int i = 0; i < NB_EXPIRY; i++)
     {
         double expiryTime = VOLS.relativeTime(TEST_EXPIRY[i]);
         for (int j = 0; j < NB_STRIKE; ++j)
         {
             double volExpected = SURFACE.zValue(expiryTime, TEST_STRIKE[j]);
             double volComputed = VOLS.volatility(CURRENCY_PAIR, TEST_EXPIRY[i], TEST_STRIKE[j], FORWARD[i]);
             assertEquals(volComputed, volExpected, TOLERANCE);
         }
     }
 }
        //-------------------------------------------------------------------------
        // bumping a node point at (nodeExpiry, nodeStrike)
        private double nodeSensitivity(BlackFxOptionSurfaceVolatilities provider, CurrencyPair pair, ZonedDateTime expiry, double strike, double forward, double nodeExpiry, double nodeStrike)
        {
            NodalSurface surface = (NodalSurface)provider.Surface;
            DoubleArray  xValues = surface.XValues;
            DoubleArray  yValues = surface.YValues;
            DoubleArray  zValues = surface.ZValues;
            int          nData   = xValues.size();
            int          index   = -1;

            for (int i = 0; i < nData; ++i)
            {
                if (Math.Abs(xValues.get(i) - nodeExpiry) < TOLERANCE && Math.Abs(yValues.get(i) - nodeStrike) < TOLERANCE)
                {
                    index = i;
                }
            }
            Surface surfaceUp = surface.withZValues(zValues.with(index, zValues.get(index) + EPS));
            Surface surfaceDw = surface.withZValues(zValues.with(index, zValues.get(index) - EPS));
            BlackFxOptionSurfaceVolatilities provUp = BlackFxOptionSurfaceVolatilities.of(CURRENCY_PAIR, VAL_DATE_TIME, surfaceUp);
            BlackFxOptionSurfaceVolatilities provDw = BlackFxOptionSurfaceVolatilities.of(CURRENCY_PAIR, VAL_DATE_TIME, surfaceDw);
            double volUp = provUp.volatility(pair, expiry, strike, forward);
            double volDw = provDw.volatility(pair, expiry, strike, forward);

            return(0.5 * (volUp - volDw) / EPS);
        }