@Test(enabled = false)
  /** Tests of performance. "enabled = false" for the standard testing. */
  public void performanceCoupon() {
    long startTime, endTime;
    final int nbTest = 1000;

    startTime = System.currentTimeMillis();
    for (int looptest = 0; looptest < nbTest; looptest++) {
      METHOD_STANDARD_CPN.presentValue(CMS_COUPON, SABR_MULTICURVES);
      METHOD_STANDARD_CPN.presentValueCurveSensitivity(CMS_COUPON, SABR_MULTICURVES);
      METHOD_STANDARD_CPN.presentValueSABRSensitivity(CMS_COUPON, SABR_MULTICURVES);
    }
    endTime = System.currentTimeMillis();
    System.out.println(
        nbTest
            + " CMS coupon by replication SABR standard (price+delta+vega): "
            + (endTime - startTime)
            + " ms");

    startTime = System.currentTimeMillis();
    for (int looptest = 0; looptest < nbTest; looptest++) {
      METHOD_EXTRAPOLATION_CPN.presentValue(CMS_COUPON, SABR_MULTICURVES);
      METHOD_EXTRAPOLATION_CPN.presentValueCurveSensitivity(CMS_COUPON, SABR_MULTICURVES);
      METHOD_EXTRAPOLATION_CPN.presentValueSABRSensitivity(CMS_COUPON, SABR_MULTICURVES);
    }
    endTime = System.currentTimeMillis();
    System.out.println(
        nbTest
            + " CMS coupon by replication SABR with extrapolation (price+delta+vega): "
            + (endTime - startTime)
            + " ms");
    // Performance note: price (standard SABR): 15-Nov-11: On Mac Pro 3.2 GHz Quad-Core Intel Xeon:
    // 55 ms for 1000 CMS coupon 5Y.
    // Performance note: price (SABR with extrapolation): 15-Nov-11: On Mac Pro 3.2 GHz Quad-Core
    // Intel Xeon: 80 ms for 1000 CMS coupon 5Y.
    // Performance note: price+delta (standard SABR): 15-Nov-11: On Mac Pro 3.2 GHz Quad-Core Intel
    // Xeon: 215 ms for 1000 CMS coupon 5Y.
    // Performance note: price+delta (SABR with extrapolation): 15-Nov-11: On Mac Pro 3.2 GHz
    // Quad-Core Intel Xeon: 455 ms for 1000 CMS coupon 5Y.
    // Performance note: price+delta+vega (standard SABR): 18-Apr-2012: On Mac Pro 3.2 GHz Quad-Core
    // Intel Xeon: 710 ms for 1000 CMS coupon 5Y.
    // Performance note: price+delta+vega (SABR with extrapolation): 18-Apr-2012: On Mac Pro 3.2 GHz
    // Quad-Core Intel Xeon: 690 ms for 1000 CMS coupon 5Y.

  }
 @Test(enabled = true)
 /**
  * Tests to estimate the impact of mu on the CMS coupon pricing. "enabled = false" for the
  * standard testing.
  */
 public void testPriceMultiMu() {
   final double[] mu = new double[] {1.10, 1.30, 1.55, 2.25, 3.50, 6.00, 15.0};
   final int nbMu = mu.length;
   final double priceCouponStd =
       METHOD_STANDARD_CPN.presentValue(CMS_COUPON, SABR_MULTICURVES).getAmount(EUR);
   @SuppressWarnings("unused")
   final double rateCouponStd =
       priceCouponStd
           / (CMS_COUPON.getPaymentYearFraction()
               * CMS_COUPON.getNotional()
               * MULTICURVES.getDiscountFactor(EUR, CMS_COUPON.getPaymentTime()));
   final double[] priceCouponExtra = new double[nbMu];
   final double[] rateCouponExtra = new double[nbMu];
   for (int loopmu = 0; loopmu < nbMu; loopmu++) {
     final CouponCMSSABRExtrapolationRightReplicationMethod methodExtrapolation =
         new CouponCMSSABRExtrapolationRightReplicationMethod(CUT_OFF_STRIKE, mu[loopmu]);
     priceCouponExtra[loopmu] =
         methodExtrapolation.presentValue(CMS_COUPON, SABR_MULTICURVES).getAmount(EUR);
     rateCouponExtra[loopmu] =
         priceCouponExtra[loopmu]
             / (CMS_COUPON.getPaymentYearFraction()
                 * CMS_COUPON.getNotional()
                 * MULTICURVES.getDiscountFactor(EUR, CMS_COUPON.getPaymentTime()));
   }
   final double priceCouponNoAdj =
       METHOD_DSC_CPN.presentValue(CMS_COUPON, MULTICURVES).getAmount(EUR);
   final double rateCouponNoAdj =
       priceCouponNoAdj
           / (CMS_COUPON.getPaymentYearFraction()
               * CMS_COUPON.getNotional()
               * MULTICURVES.getDiscountFactor(EUR, CMS_COUPON.getPaymentTime()));
   for (int loopmu = 1; loopmu < nbMu; loopmu++) {
     assertTrue(
         "Extrapolation: comparison with standard method",
         rateCouponExtra[loopmu - 1] > rateCouponExtra[loopmu]);
   }
   assertTrue(
       "Extrapolation: comparison with standard method",
       rateCouponExtra[nbMu - 1] > rateCouponNoAdj);
 }
 /**
  * Test the present value for a CMS coupon with pricing by replication in the SABR with
  * extrapolation framework. The present value is tested against hard-coded value and cap of strike
  * 0.
  */
 public void presentValue() {
   // CMS cap/floor with strike 0 has the same price as a CMS coupon.
   final double priceCouponStd =
       METHOD_STANDARD_CPN.presentValue(CMS_COUPON, SABR_MULTICURVES).getAmount(EUR).getAmount();
   final double rateCouponStd =
       priceCouponStd
           / (CMS_COUPON.getPaymentYearFraction()
               * CMS_COUPON.getNotional()
               * MULTICURVES.getDiscountFactor(EUR, CMS_COUPON.getPaymentTime()));
   final double priceCouponExtra =
       METHOD_EXTRAPOLATION_CPN
           .presentValue(CMS_COUPON, SABR_MULTICURVES)
           .getAmount(EUR)
           .getAmount();
   final double rateCouponExtra =
       priceCouponExtra
           / (CMS_COUPON.getPaymentYearFraction()
               * CMS_COUPON.getNotional()
               * MULTICURVES.getDiscountFactor(EUR, CMS_COUPON.getPaymentTime()));
   final double priceCouponNoAdj =
       METHOD_DSC_CPN.presentValue(CMS_COUPON, MULTICURVES).getAmount(EUR).getAmount();
   final double rateCouponNoAdj =
       priceCouponNoAdj
           / (CMS_COUPON.getPaymentYearFraction()
               * CMS_COUPON.getNotional()
               * MULTICURVES.getDiscountFactor(EUR, CMS_COUPON.getPaymentTime()));
   assertEquals(
       "Extrapolation: comparison with standard method", rateCouponStd > rateCouponExtra, true);
   assertEquals(
       "Extrapolation: comparison with no convexity adjustment",
       rateCouponExtra > rateCouponNoAdj,
       true);
   final double rateCouponExtraExpected = 0.0189864; // From previous run.
   assertEquals("Extrapolation: hard-coded value", rateCouponExtraExpected, rateCouponExtra, 1E-6);
   final double priceCap0Extra =
       METHOD_EXTRAPOLATION_CAP
           .presentValue(CMS_CAP_0, SABR_MULTICURVES)
           .getAmount(EUR)
           .getAmount();
   assertEquals(
       "Extrapolation: CMS coupon vs Cap 0", priceCouponExtra, priceCap0Extra, TOLERANCE_PV);
 }