SmileDeltaParameters { public double[] getVolatility() { return _volatility; } SmileDeltaParameters(final double timeToExpiration, final double[] delta, final double[] volatility);  SmileDeltaParameters(final double timeToExpiry, final double atm, final double[] delta, final double[] riskReversal, final double[] strangle); double[] getStrike(final double forward); double getTimeToExpiry(); double[] getDelta(); double[] getVolatility(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void constructorVolatility() { double[] volatility = SMILE.getVolatility(); SmileDeltaParameters smileFromVolatility = new SmileDeltaParameters(TIME_TO_EXPIRY, DELTA, volatility); assertEquals("Smile by delta: constructor", SMILE, smileFromVolatility); }
@Test public void volatility() { double[] volatility = SMILE.getVolatility(); int nbDelta = DELTA.length; assertEquals("Volatility: ATM", ATM, volatility[nbDelta]); for (int loopdelta = 0; loopdelta < nbDelta; loopdelta++) { assertEquals("Volatility: Risk Reversal " + loopdelta, RISK_REVERSAL[loopdelta], volatility[2 * nbDelta - loopdelta] - volatility[loopdelta], 1.0E-8); assertEquals("Volatility: Strangle " + loopdelta, STRANGLE[loopdelta], (volatility[2 * nbDelta - loopdelta] + volatility[loopdelta]) / 2 - volatility[nbDelta], 1.0E-8); } }