class YieldSensitivityCalculator {

  public double calculateYield(final Annuity<? extends PaymentFixed> annuity, final double pv) {
    Validate.notNull(annuity, "annuity");
    final Function1D<Double, Double> f = new Function1D<Double, Double>() {

      @Override
      public Double evaluate(final Double y) {
        return calculatePriceForYield(annuity, y) - pv;
      }

    };

    final double[] range = BRACKETER.getBracketedPoints(f, 0.0, 0.2);
    return ROOT_FINDER.getRoot(f, range[0], range[1]);
  }

  private  YieldSensitivityCalculator();

}