### Question:
DiscountingCmsProductPricer { public MultiCurrencyAmount presentValue( ResolvedCms cms, RatesProvider ratesProvider) { CurrencyAmount pvCmsLeg = cmsLegPricer.presentValue(cms.getCmsLeg(), ratesProvider); if (!cms.getPayLeg().isPresent()) { return MultiCurrencyAmount.of(pvCmsLeg); } CurrencyAmount pvPayLeg = swapPricer.getLegPricer().presentValue(cms.getPayLeg().get(), ratesProvider); return MultiCurrencyAmount.of(pvCmsLeg).plus(pvPayLeg); } DiscountingCmsProductPricer(DiscountingSwapProductPricer swapPricer); MultiCurrencyAmount presentValue(
      ResolvedCms cms,
      RatesProvider ratesProvider); PointSensitivityBuilder presentValueSensitivity(
      ResolvedCms cms,
      RatesProvider ratesProvider); MultiCurrencyAmount currencyExposure(
      ResolvedCms cms,
      RatesProvider ratesProvider); MultiCurrencyAmount currentCash(
      ResolvedCms cms,
      RatesProvider ratesProvider); static final DiscountingCmsProductPricer DEFAULT; }### Answer:
@Test public void test_presentValue() { MultiCurrencyAmount pv1 = PRODUCT_PRICER.presentValue(CMS_ONE_LEG, RATES_PROVIDER); MultiCurrencyAmount pv2 = PRODUCT_PRICER.presentValue(CMS_TWO_LEGS, RATES_PROVIDER); CurrencyAmount pvCms = CMS_LEG_PRICER.presentValue(CMS_LEG, RATES_PROVIDER); CurrencyAmount pvPay = SWAP_LEG_PRICER.presentValue(PAY_LEG, RATES_PROVIDER); assertThat(pv1).isEqualTo(MultiCurrencyAmount.of(pvCms)); assertThat(pv2).isEqualTo(MultiCurrencyAmount.of(pvCms).plus(pvPay)); }