LognormalSkewnessFromVolatilityCalculator extends Function2D<Double, Double> { @Override public Double evaluate(final Double sigma, final Double t) { Validate.notNull(sigma, "sigma"); Validate.notNull(t, "t"); final double y = Math.sqrt(Math.exp(sigma * sigma * t) - 1); return y * (3 + y * y); }  @Override Double evaluate(final Double sigma, final Double t);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullSigma() { F.evaluate(null, T); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullT() { F.evaluate(SIGMA, null); }
@Test public void test() { assertEquals(F.evaluate(SIGMA, T), 0.4560, 1e-4); }