### Question:
DiscountingFraTradePricer { public CurrencyAmount currentCash(ResolvedFraTrade trade, RatesProvider provider) { ResolvedFra fra = trade.getProduct(); if (fra.getPaymentDate().isEqual(provider.getValuationDate())) { return productPricer.presentValue(fra, provider); } return CurrencyAmount.zero(fra.getCurrency()); } DiscountingFraTradePricer(
      DiscountingFraProductPricer productPricer); DiscountingFraProductPricer getProductPricer(); CurrencyAmount presentValue(ResolvedFraTrade trade, RatesProvider provider); ExplainMap explainPresentValue(ResolvedFraTrade trade, RatesProvider provider); PointSensitivities presentValueSensitivity(ResolvedFraTrade trade, RatesProvider provider); CurrencyAmount forecastValue(ResolvedFraTrade trade, RatesProvider provider); PointSensitivities forecastValueSensitivity(ResolvedFraTrade trade, RatesProvider provider); double parRate(ResolvedFraTrade trade, RatesProvider provider); PointSensitivities parRateSensitivity(ResolvedFraTrade trade, RatesProvider provider); double parSpread(ResolvedFraTrade trade, RatesProvider provider); PointSensitivities parSpreadSensitivity(ResolvedFraTrade trade, RatesProvider provider); CashFlows cashFlows(ResolvedFraTrade trade, RatesProvider provider); MultiCurrencyAmount currencyExposure(ResolvedFraTrade trade, RatesProvider provider); CurrencyAmount currentCash(ResolvedFraTrade trade, RatesProvider provider); static final DiscountingFraTradePricer DEFAULT; }### Answer:
@Test public void test_currentCash_zero() { assertThat(PRICER_TRADE.currentCash(RFRA_TRADE, RATES_PROVIDER)).isEqualTo(CurrencyAmount.zero(FRA.getCurrency())); }
@Test public void test_currentCash_onPaymentDate() { LocalDate paymentDate = RFRA.getPaymentDate(); double publishedRate = 0.025; ResolvedFraTrade trade = FraTrade.builder() .info(TradeInfo.builder().tradeDate(paymentDate).build()) .product(FRA) .build() .resolve(REF_DATA); ImmutableRatesProvider ratesProvider = RatesProviderDataSets.multiGbp(paymentDate).toBuilder() .timeSeries(GBP_LIBOR_3M, LocalDateDoubleTimeSeries.of(paymentDate, publishedRate)) .build(); assertThat(PRICER_TRADE.currentCash(trade, ratesProvider)).isEqualTo(CurrencyAmount.of(FRA.getCurrency(), (publishedRate - FRA.getFixedRate()) / (1d + publishedRate * RFRA.getYearFraction()) * RFRA.getYearFraction() * RFRA.getNotional())); }