BlackPriceFunction implements OptionPriceFunction<BlackFunctionData> { public Function1D<BlackFunctionData, Double> getVegaFunction(final EuropeanVanillaOption option) { Validate.notNull(option, "option"); final double k = option.getStrike(); final double t = option.getTimeToExpiry(); return new Function1D<BlackFunctionData, Double>() { @Override public Double evaluate(final BlackFunctionData data) { Validate.notNull(data, "data"); final double sigma = data.getBlackVolatility(); final double f = data.getForward(); final double discountFactor = data.getDiscountFactor(); return discountFactor * BlackFormulaRepository.vega(f, k, t, sigma); } }; }  @Override Function1D<BlackFunctionData, Double> getPriceFunction(final EuropeanVanillaOption option); double[] getPriceAdjoint(final EuropeanVanillaOption option, final BlackFunctionData data); double getPriceAdjoint2(final EuropeanVanillaOption option, final BlackFunctionData data, double[] bsD, double[][] bsD2); Function1D<BlackFunctionData, Double> getVegaFunction(final EuropeanVanillaOption option);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullData2() { FUNCTION.getVegaFunction(ATM_CALL).evaluate((BlackFunctionData) null); }