EuropeanPriceIntegrand { public Function1D<Double, Double> getFunction(final BlackFunctionData data, final EuropeanVanillaOption option) { Validate.notNull(data, "data"); Validate.notNull(option, "option"); final double t = option.getTimeToExpiry(); final Function1D<ComplexNumber, ComplexNumber> characteristicFunction = _ce.getFunction(t); final double k = Math.log(option.getStrike() / data.getForward()); final double blackVol = data.getBlackVolatility(); final CharacteristicExponent gaussian; final Function1D<ComplexNumber, ComplexNumber> gaussianFunction; if (_useVarianceReduction) { gaussian = new GaussianCharacteristicExponent(-0.5 * blackVol * blackVol, blackVol); gaussianFunction = gaussian.getFunction(t); } else { gaussian = null; gaussianFunction = null; } return new Function1D<Double, Double>() { @Override public Double evaluate(final Double x) { @SuppressWarnings("synthetic-access") final ComplexNumber res = getIntegrand(x, characteristicFunction, gaussianFunction, k); return res.getReal(); } }; } EuropeanPriceIntegrand(final MartingaleCharacteristicExponent ce, final double alpha, final boolean useVarianceReduction); Function1D<Double, Double> getFunction(final BlackFunctionData data, final EuropeanVanillaOption option); MartingaleCharacteristicExponent getCharacteristicExponent(); double getAlpha(); boolean useVarianceReduction(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullData() { INTEGRAND.getFunction(null, OPTION); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullOption() { INTEGRAND.getFunction(DATA, null); }