/** Test cash flow for ISDA FRA Discounting method. */
  public void test_cashFlows_ISDA() {
    ExpandedFra fraExp = FRA.expand();
    SimpleRatesProvider prov = createProvider(fraExp);

    double fixedRate = FRA.getFixedRate();
    double yearFraction = fraExp.getYearFraction();
    double notional = fraExp.getNotional();
    double expected =
        notional * yearFraction * (FORWARD_RATE - fixedRate) / (1.0 + yearFraction * FORWARD_RATE);

    DiscountingFraProductPricer test = DiscountingFraProductPricer.DEFAULT;
    CashFlows computed = test.cashFlows(fraExp, prov);
    assertEquals(computed.getCashFlows().size(), 1);
    assertEquals(computed.getCashFlows().size(), 1);
    assertEquals(computed.getCashFlows().get(0).getPaymentDate(), fraExp.getPaymentDate());
    assertEquals(
        computed.getCashFlows().get(0).getForecastValue().getCurrency(), fraExp.getCurrency());
    assertEquals(
        computed.getCashFlows().get(0).getForecastValue().getAmount(), expected, TOLERANCE);

    // test via FraTrade
    DiscountingFraTradePricer testTrade = new DiscountingFraTradePricer(test);
    assertEquals(testTrade.cashFlows(FRA_TRADE, prov), test.cashFlows(fraExp, prov));
  }