### Question:
DiscountingTermDepositTradePricer { public CurrencyAmount currentCash(ResolvedTermDepositTrade trade, RatesProvider provider) { ResolvedTermDeposit product = trade.getProduct(); if (product.getStartDate().isEqual(provider.getValuationDate())) { return CurrencyAmount.of(product.getCurrency(), -product.getNotional()); } if (product.getEndDate().isEqual(provider.getValuationDate())) { return CurrencyAmount.of(product.getCurrency(), product.getNotional() + product.getInterest()); } return CurrencyAmount.zero(product.getCurrency()); } DiscountingTermDepositTradePricer(DiscountingTermDepositProductPricer productPricer); CurrencyAmount presentValue(ResolvedTermDepositTrade trade, RatesProvider provider); PointSensitivities presentValueSensitivity(ResolvedTermDepositTrade trade, RatesProvider provider); double parRate(ResolvedTermDepositTrade trade, RatesProvider provider); PointSensitivities parRateSensitivity(ResolvedTermDepositTrade trade, RatesProvider provider); double parSpread(ResolvedTermDepositTrade trade, RatesProvider provider); PointSensitivities parSpreadSensitivity(ResolvedTermDepositTrade trade, RatesProvider provider); MultiCurrencyAmount currencyExposure(ResolvedTermDepositTrade trade, RatesProvider provider); CurrencyAmount currentCash(ResolvedTermDepositTrade trade, RatesProvider provider); static final DiscountingTermDepositTradePricer DEFAULT; }### Answer:
@Test public void test_currentCash_onStartDate() { RatesProvider prov = ImmutableRatesProvider.builder(RDEPOSIT_TRADE.getProduct().getStartDate()) .discountCurve(EUR, CURVE) .build(); assertThat(PRICER_TRADE.currentCash(RDEPOSIT_TRADE, prov)).isEqualTo(CurrencyAmount.of(EUR, -NOTIONAL)); }
@Test public void test_currentCash_onEndDate() { RatesProvider prov = ImmutableRatesProvider.builder(RDEPOSIT_TRADE.getProduct().getEndDate()) .discountCurve(EUR, CURVE) .build(); assertThat(PRICER_TRADE.currentCash(RDEPOSIT_TRADE, prov)).isEqualTo(CurrencyAmount.of(EUR, NOTIONAL + INTEREST)); }
@Test public void test_currentCash_otherDate() { assertThat(PRICER_TRADE.currentCash(RDEPOSIT_TRADE, IMM_PROV)).isEqualTo(CurrencyAmount.zero(EUR)); }