class SVIVolatilityFunction extends VolatilityFunctionProvider<SVIFormulaData> {

  @Override
  public Function1D<SVIFormulaData, Double> getVolatilityFunction(final EuropeanVanillaOption option, final double forward) {
    Validate.notNull(option, "option");
    Validate.isTrue(forward > 0, "Need forward >= 0");
    final double strike = option.getStrike();
    Validate.isTrue(strike > 0, "Need strike >= 0");
    final double kappa = Math.log(strike / forward);

    return new Function1D<SVIFormulaData, Double>() {
      @SuppressWarnings("synthetic-access")
      @Override
      public Double evaluate(final SVIFormulaData data) {
        return getVolatility(kappa, data);
      }
    };
  }

}