CouponCMS extends CouponFloating { @SuppressWarnings("deprecation") @Override public CouponCMS withNotional(final double notional) { try { return new CouponCMS(getCurrency(), getPaymentTime(), getFundingCurveName(), getPaymentYearFraction(), notional, getFixingTime(), _underlyingSwap, _settlementTime); } catch (final IllegalStateException e) { return new CouponCMS(getCurrency(), getPaymentTime(), getPaymentYearFraction(), notional, getFixingTime(), _underlyingSwap, _settlementTime); } } @Deprecated  CouponCMS(final Currency currency, final double paymentTime, final String fundingCurveName, final double paymentYearFraction, final double notional,
      final double fixingTime, final SwapFixedCoupon<? extends Payment> underlyingSwap, final double settlementTime);  CouponCMS(final Currency currency, final double paymentTime, final double paymentYearFraction, final double notional,
      final double fixingTime, final SwapFixedCoupon<? extends Payment> underlyingSwap, final double settlementTime); @SuppressWarnings("deprecation") static CouponCMS from(final CouponFloating coupon, final SwapFixedCoupon<? extends Payment> underlyingSwap, final double settlementTime); SwapFixedCoupon<? extends Payment> getUnderlyingSwap(); double getSettlementTime(); @SuppressWarnings("deprecation") @Override CouponCMS withNotional(final double notional); @Override T accept(final InstrumentDerivativeVisitor<S, T> visitor, final S data); @Override T accept(final InstrumentDerivativeVisitor<?, T> visitor); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testWithNotional() { final double notional = NOTIONAL + 10000; final CouponCMS coupon = new CouponCMS(CUR, 0.25, 0.25, NOTIONAL, 0.25, SWAP, 0.25); final CouponCMS expected = new CouponCMS(CUR, 0.25, 0.25, notional, 0.25, SWAP, 0.25); assertEquals(expected, coupon.withNotional(notional)); }