BlackForexTermStructureParameters implements VolatilityModel<Double> { @Override public Double getVolatility(final Double time) { ArgumentChecker.notNull(time, "t"); return _volatility.getYValue(time); } BlackForexTermStructureParameters(final DoublesCurve volatility); DoublesCurve getVolatilityCurve(); Double[] getVolatilityTimeSensitivity(final double t); @Override Double getVolatility(final Double time); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullTime() { BLACK_TERM_STRUCTURE.getVolatility(null); }
@Test public void getVolatility() { final double[] times = new double[] {0.30, 2.54, 5.0, 10.1}; for (final double time : times) { assertEquals("Black Forex Term Structure: getVolatility", TERM_STRUCTURE_VOL.getYValue(time), BLACK_TERM_STRUCTURE.getVolatility(time)); } }