### Question:
SabrExtrapolationReplicationCmsLegPricer { public PointSensitivityBuilder presentValueSensitivityModelParamsSabr( ResolvedCmsLeg cmsLeg, RatesProvider ratesProvider, SabrSwaptionVolatilities swaptionVolatilities) { validate(ratesProvider, swaptionVolatilities); return cmsLeg.getCmsPeriods().stream() .map(cmsPeriod -> cmsPeriodPricer.presentValueSensitivityModelParamsSabr(cmsPeriod, ratesProvider, swaptionVolatilities)) .reduce(PointSensitivityBuilder.none(), PointSensitivityBuilder::combinedWith) .normalize(); } SabrExtrapolationReplicationCmsLegPricer(SabrExtrapolationReplicationCmsPeriodPricer cmsPeriodPricer); CurrencyAmount presentValue(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider,
      SabrSwaptionVolatilities swaptionVolatilities); ExplainMap explainPresentValue(
      ResolvedCmsLeg cmsLeg,
      RatesProvider provider,
      SabrSwaptionVolatilities volatilities); PointSensitivityBuilder presentValueSensitivityRates(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider,
      SabrSwaptionVolatilities swaptionVolatilities); PointSensitivityBuilder presentValueSensitivityModelParamsSabr(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider,
      SabrSwaptionVolatilities swaptionVolatilities); double presentValueSensitivityStrike(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider,
      SabrSwaptionVolatilities swaptionVolatilities); CurrencyAmount currentCash(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider,
      SabrSwaptionVolatilities swaptionVolatilities);  }### Answer:
@Test public void test_presentValueSensitivitySabrParameter() { PointSensitivityBuilder computed = LEG_PRICER.presentValueSensitivityModelParamsSabr(FLOOR_LEG, RATES_PROVIDER, VOLATILITIES); PointSensitivityBuilder expected = PointSensitivityBuilder.none(); List<CmsPeriod> cms = FLOOR_LEG.getCmsPeriods(); int size = cms.size(); for (int i = 0; i < size; ++i) { expected = expected.combinedWith( PERIOD_PRICER.presentValueSensitivityModelParamsSabr(cms.get(i), RATES_PROVIDER, VOLATILITIES)); } assertThat(computed).isEqualTo(expected); }
@Test public void test_presentValueSensitivitySabrParameter_afterPay() { PointSensitivityBuilder computed = LEG_PRICER.presentValueSensitivityModelParamsSabr(FLOOR_LEG, RATES_PROVIDER_AFTER_PERIOD, VOLATILITIES_AFTER_PERIOD); PointSensitivityBuilder expected = PointSensitivityBuilder.none(); List<CmsPeriod> cms = FLOOR_LEG.getCmsPeriods(); int size = cms.size(); for (int i = 0; i < size; ++i) { expected = expected.combinedWith(PERIOD_PRICER.presentValueSensitivityModelParamsSabr( cms.get(i), RATES_PROVIDER_AFTER_PERIOD, VOLATILITIES_AFTER_PERIOD)); } assertThat(computed).isEqualTo(expected); }
@Test public void test_presentValueSensitivitySabrParameter_ended() { PointSensitivities computed = LEG_PRICER.presentValueSensitivityModelParamsSabr(CAP_LEG, RATES_PROVIDER_ENDED, VOLATILITIES_ENDED).build(); assertThat(computed).isEqualTo(PointSensitivities.empty()); }