PriceIndexCurveMultiplyFixedCurve implements PriceIndexCurve { @Override public double[] getPriceIndexParameterSensitivity(final double time) { double[] sensiUnderlying = _curve.getPriceIndexParameterSensitivity(time); double[] sensi = new double[sensiUnderlying.length]; for (int i = 0; i < sensiUnderlying.length; i++) { sensi[i] = sensiUnderlying[i] * _fixedCurve.getYValue(time); } return sensi; } PriceIndexCurveMultiplyFixedCurve(final String name, final PriceIndexCurve curve, 
      final DoublesCurve fixedCurve); @Override double getPriceIndex(final Double timeToIndex); @Override double getInflationRate(final Double firstTime, final Double secondTime); @Override double[] getPriceIndexParameterSensitivity(final double time); @Override int getNumberOfParameters(); @Override List<String> getUnderlyingCurvesNames(); @Override String getName(); @Override int getNumberOfIntrinsicParameters(Set<String> curvesNames); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void getPriceIndexParameterSensitivity() { int nbTime = 25; for (int looptime = 0; looptime <= nbTime; looptime++) { double[] sensiUnderlying = UNDERLYING_CURVE.getPriceIndexParameterSensitivity(SEASONAL_STEPS[looptime]); double[] sensiComputed = PI_CURVE.getPriceIndexParameterSensitivity(SEASONAL_STEPS[looptime]); double[] sensiExpected = new double[sensiUnderlying.length]; for(int loopparam = 0 ; loopparam < sensiUnderlying.length; loopparam++) { sensiExpected[loopparam] = sensiUnderlying[loopparam] * SEASONAL_CURVE.getYValue(SEASONAL_STEPS[looptime]); assertEquals("PriceIndexCurveMultiplyFixedCurve: price index parameter sensitivity", sensiExpected[loopparam], sensiComputed[loopparam], TOLERANCE_INDEX); } } }