code: public double getValueWithGivenYield(double evaluationTime, double rate, AnalyticModel model) {
  		DiscountCurve referenceCurve = DiscountCurveInterpolation.createDiscountCurveFromDiscountFactors("referenceCurve", new double[] {0.0, 1.0}, new double[]  {1.0, 1.0});
  		return getValueWithGivenSpreadOverCurve(evaluationTime, referenceCurve, rate, model);
  	}
docs: Returns the value of the sum of discounted cash flows of the bond where
  the discounting is done with the given yield curve.
  This method can be used for optimizer.
  
  @param evaluationTime The evaluation time as double. Cash flows prior and including this time are not considered.
  @param rate The yield which is used for discounted the coupon payments.
  @param model The model under which the product is valued.
  @return The value of the bond for the given yield.