class BlackScholesGeometricBrownianMotionProcess extends StochasticProcess<T, U> {

  @Override
  public Function1D<Double, Double> getPathGeneratingFunction(final T t, final U u, final int steps) {
    Validate.notNull(t);
    Validate.notNull(u);
    if (steps < 1) {
      throw new IllegalArgumentException("Number of steps must be greater than zero");
    }
    final double k = t.getStrike();
    final double m = t.getTimeToExpiry(u.getDate());
    final double sigma = u.getVolatility(m, k);
    final double b = u.getCostOfCarry();
    final double dt = m / steps;
    final double sigmaSq = sigma * sigma;
    final double nu = dt * (b - 0.5 * sigmaSq);
    final double sigmaDt = sigma * Math.sqrt(dt);
    return new Function1D<Double, Double>() {

      @Override
      public Double evaluate(final Double e) {
        return nu + sigmaDt * e;
      }
    };
  }

}