### Question:
DiscountingSwapProductPricer { public MultiCurrencyAmount currentCash(ResolvedSwap swap, RatesProvider provider) { MultiCurrencyAmount ce = MultiCurrencyAmount.empty(); for (ResolvedSwapLeg leg : swap.getLegs()) { ce = ce.plus(legPricer.currentCash(leg, provider)); } return ce; } DiscountingSwapProductPricer(
      DiscountingSwapLegPricer legPricer); DiscountingSwapLegPricer getLegPricer(); CurrencyAmount presentValue(ResolvedSwap swap, Currency currency, RatesProvider provider); MultiCurrencyAmount presentValue(ResolvedSwap swap, RatesProvider provider); MultiCurrencyAmount forecastValue(ResolvedSwap swap, RatesProvider provider); MultiCurrencyAmount accruedInterest(ResolvedSwap swap, RatesProvider provider); double parRate(ResolvedSwap swap, RatesProvider provider); double marketQuote(ResolvedSwap swap, RatesProvider provider); double parSpread(ResolvedSwap swap, RatesProvider provider); PointSensitivityBuilder presentValueSensitivity(ResolvedSwap swap, RatesProvider provider); PointSensitivityBuilder presentValueSensitivity(ResolvedSwap swap, Currency currency, RatesProvider provider); PointSensitivityBuilder forecastValueSensitivity(ResolvedSwap swap, RatesProvider provider); PointSensitivityBuilder parRateSensitivity(ResolvedSwap swap, RatesProvider provider); PointSensitivityBuilder marketQuoteSensitivity(ResolvedSwap swap, RatesProvider provider); PointSensitivityBuilder parSpreadSensitivity(ResolvedSwap swap, RatesProvider provider); CashFlows cashFlows(ResolvedSwap swap, RatesProvider provider); ExplainMap explainPresentValue(ResolvedSwap swap, RatesProvider provider); MultiCurrencyAmount currencyExposure(ResolvedSwap swap, RatesProvider provider); MultiCurrencyAmount currentCash(ResolvedSwap swap, RatesProvider provider); static final DiscountingSwapProductPricer DEFAULT; }### Answer:
@Test public void test_currentCash_zero() { MultiCurrencyAmount computed = SWAP_PRODUCT_PRICER.currentCash(SWAP_CROSS_CURRENCY, RATES_GBP_USD); assertThat(computed).isEqualTo(MultiCurrencyAmount.of(CurrencyAmount.zero(GBP), CurrencyAmount.zero(USD))); MultiCurrencyAmount fromTrade = SWAP_TRADE_PRICER.currentCash(SWAP_TRADE_CROSS_CURRENCY, RATES_GBP_USD); assertThat(fromTrade).isEqualTo(computed); }