YieldAndDiscountAddZeroFixedCurve extends YieldAndDiscountCurve { @Override public double getInterestRate(final Double t) { return _curve.getInterestRate(t) + _sign * _curveFixed.getInterestRate(t); } YieldAndDiscountAddZeroFixedCurve(final String name, final boolean substract, final YieldAndDiscountCurve curve, final YieldAndDiscountCurve curveFixed); @Override double getInterestRate(final Double t); @Override double getForwardRate(final double t); @Override double[] getInterestRateParameterSensitivity(final double time); @Override int getNumberOfParameters(); @Override int getNumberOfIntrinsicParameters(final Set<String> curvesNames); @Override List<String> getUnderlyingCurvesNames(); YieldAndDiscountCurve getCurve(); YieldAndDiscountCurve getCurveFixed(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void interestRate() { double[] t = {0.5, 1.0, 2.75}; for (int loopt = 0; loopt < t.length; loopt++) { assertEquals("YieldAndDiscountAddZeroFixedCurve: rate", CURVE_MAIN.getInterestRate(t[loopt]) + CURVE_FIXED.getInterestRate(t[loopt]), CURVE_TOTAL.getInterestRate(t[loopt]), TOLERANCE_RATE); } }