class HeavisideFunction extends Function1D<Double, Double> {

  @Override
  public Double evaluate(final Double x) {
    Validate.notNull(x);
    if (x < 0) {
      return 0.;
    }
    if (x > 0) {
      return 1.;
    }
    throw new IllegalArgumentException("Heaviside function is not defined for x = 0");
  }

}