class 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);
      }
    };
  }

}