### Question:
DiscountingCmsProductPricer { public MultiCurrencyAmount currentCash( ResolvedCms cms, RatesProvider ratesProvider) { CurrencyAmount ccCmsLeg = cmsLegPricer.currentCash(cms.getCmsLeg(), ratesProvider); if (!cms.getPayLeg().isPresent()) { return MultiCurrencyAmount.of(ccCmsLeg); } CurrencyAmount ccPayLeg = swapPricer.getLegPricer().currentCash(cms.getPayLeg().get(), ratesProvider); return MultiCurrencyAmount.of(ccPayLeg).plus(ccCmsLeg); } 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_currentCash() { MultiCurrencyAmount cc1 = PRODUCT_PRICER.currentCash(CMS_ONE_LEG, RATES_PROVIDER); MultiCurrencyAmount cc2 = PRODUCT_PRICER.currentCash(CMS_TWO_LEGS, RATES_PROVIDER); assertThat(cc1).isEqualTo(MultiCurrencyAmount.of(CurrencyAmount.zero(EUR))); assertThat(cc2).isEqualTo(MultiCurrencyAmount.of(CurrencyAmount.zero(EUR))); }
@Test public void test_currentCash_onPay() { MultiCurrencyAmount cc1 = PRODUCT_PRICER.currentCash(CMS_ONE_LEG, RATES_PROVIDER_ON_PAY); MultiCurrencyAmount cc2 = PRODUCT_PRICER.currentCash(CMS_TWO_LEGS, RATES_PROVIDER_ON_PAY); CurrencyAmount ccCms = CMS_LEG_PRICER.currentCash(CMS_LEG, RATES_PROVIDER_ON_PAY); CurrencyAmount ccPay = SWAP_LEG_PRICER.currentCash(PAY_LEG, RATES_PROVIDER_ON_PAY); assertThat(cc1).isEqualTo(MultiCurrencyAmount.of(ccCms)); assertThat(cc2).isEqualTo(MultiCurrencyAmount.of(ccCms).plus(ccPay)); }