### Question:
DiscountingFxSwapProductPricer { public MultiCurrencyAmount currentCash(ResolvedFxSwap swap, LocalDate valuationDate) { MultiCurrencyAmount farPv = fxPricer.currentCash(swap.getFarLeg(), valuationDate); MultiCurrencyAmount nearPv = fxPricer.currentCash(swap.getNearLeg(), valuationDate); return nearPv.plus(farPv); } DiscountingFxSwapProductPricer(
      DiscountingFxSingleProductPricer fxPricer); MultiCurrencyAmount presentValue(ResolvedFxSwap swap, RatesProvider provider); PointSensitivities presentValueSensitivity(ResolvedFxSwap swap, RatesProvider provider); double parSpread(ResolvedFxSwap swap, RatesProvider provider); PointSensitivities parSpreadSensitivity(ResolvedFxSwap swap, RatesProvider provider); MultiCurrencyAmount currencyExposure(ResolvedFxSwap product, RatesProvider provider); MultiCurrencyAmount currentCash(ResolvedFxSwap swap, LocalDate valuationDate); static final DiscountingFxSwapProductPricer DEFAULT; }### Answer:
@Test public void test_currentCash_zero() { MultiCurrencyAmount computed = PRICER.currentCash(SWAP_PRODUCT, PROVIDER.getValuationDate()); assertThat(computed).isEqualTo(MultiCurrencyAmount.empty()); }
@Test public void test_currentCash_firstPayment() { MultiCurrencyAmount computed = PRICER.currentCash(SWAP_PRODUCT, PAYMENT_DATE_NEAR); assertThat(computed).isEqualTo(MultiCurrencyAmount.of( SWAP_PRODUCT.getNearLeg().getBaseCurrencyPayment().getValue(), SWAP_PRODUCT.getNearLeg().getCounterCurrencyPayment().getValue())); }
@Test public void test_currentCash_secondPayment() { MultiCurrencyAmount computed = PRICER.currentCash(SWAP_PRODUCT, PAYMENT_DATE_FAR); assertThat(computed).isEqualTo(MultiCurrencyAmount.of( SWAP_PRODUCT.getFarLeg().getBaseCurrencyPayment().getValue(), SWAP_PRODUCT.getFarLeg().getCounterCurrencyPayment().getValue())); }