code: public static HazardCurve createHazardCurveFromSurvivalProbabilities(
  			String name, LocalDate referenceDate,
  			double[] times, double[] givenSurvivalProbabilities, boolean[] isParameter,
  			InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
  
  		//We check that all input survival probabilities are in the range [0,1]
  		for( int i = 0; i < givenSurvivalProbabilities.length; i++){
  			if(givenSurvivalProbabilities[i] < 0 || givenSurvivalProbabilities[i] > 1) {
  				throw new IllegalArgumentException("Survival Probabilities must be between 0 and 1");
  			}
  		}
  
  		HazardCurve survivalProbabilities = new HazardCurve(name, referenceDate, interpolationMethod, extrapolationMethod, interpolationEntity);
  
  		for(int timeIndex=0; timeIndex<times.length;timeIndex++) {
  			survivalProbabilities.addSurvivalProbability(times[timeIndex], givenSurvivalProbabilities[timeIndex], isParameter != null && isParameter[timeIndex]);
  		}
  
  		return survivalProbabilities;
  	}
docs: Create a hazard curve from given times and given survival probabilities using given interpolation and extrapolation methods.
  
  @param name The name of this hazard curve.
  @param referenceDate The reference date for this curve, i.e., the date which defined t=0.
  @param times Array of times as doubles.
  @param givenSurvivalProbabilities Array of corresponding survival probabilities.
  @param isParameter Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).
  @param interpolationMethod The interpolation method used for the curve.
  @param extrapolationMethod The extrapolation method used for the curve.
  @param interpolationEntity The entity interpolated/extrapolated.
  @return A new hazard curve object.