code: public static DiscountCurveInterface createDiscountFactorsFromForwardRates(String name, TimeDiscretization tenor, RandomVariable [] forwardRates) {
  		DiscountCurveInterpolation discountFactors = new DiscountCurveInterpolation(name);
  		RandomVariable df = forwardRates[0].mult(tenor.getTimeStep(0)).add(1.0).invert();
  		discountFactors.addDiscountFactor(tenor.getTime(1), df, tenor.getTime(1) > 0);
  		for(int timeIndex=1; timeIndex<tenor.getNumberOfTimeSteps();timeIndex++) {
  			df = df.div(forwardRates[timeIndex].mult(tenor.getTimeStep(timeIndex)).add(1.0));
  			discountFactors.addDiscountFactor(tenor.getTime(timeIndex+1), df, tenor.getTime(timeIndex+1) > 0);
  		}
  
  		return discountFactors;
  	}
docs: Create a discount curve from given time discretization and forward rates.
  This function is provided for "single interest rate curve" frameworks.
  
  @param name The name of this discount curve.
  @param tenor Time discretization for the forward rates
  @param forwardRates Array of forward rates.
  @return A new discount factor object.