BondFixedSecurityDefinition extends BondSecurityDefinition<PaymentFixedDefinition, CouponFixedDefinition> { @Override public AnnuityCouponFixedDefinition getCoupons() { return (AnnuityCouponFixedDefinition) super.getCoupons(); } BondFixedSecurityDefinition(final AnnuityPaymentFixedDefinition nominal, final AnnuityCouponFixedDefinition coupon, final int exCouponDays,
      final int settlementDays, final Calendar calendar, final DayCount dayCount, final YieldConvention yieldConvention, final int couponPerYear, final boolean isEOM, final String issuer);  BondFixedSecurityDefinition(final AnnuityPaymentFixedDefinition nominal, final AnnuityCouponFixedDefinition coupon, final int exCouponDays,
      final int settlementDays, final Calendar calendar, final DayCount dayCount, final YieldConvention yieldConvention, final int couponPerYear,
      final boolean isEOM, final LegalEntity issuer);  BondFixedSecurityDefinition(final AnnuityPaymentFixedDefinition nominal, final AnnuityCouponFixedDefinition coupon, final int exCouponDays,
      final int settlementDays, final Calendar calendar, final DayCount dayCount, final YieldConvention yieldConvention, final int couponPerYear,
      final boolean isEOM, final String issuer, final String repoType);  BondFixedSecurityDefinition(final AnnuityPaymentFixedDefinition nominal, final AnnuityCouponFixedDefinition coupon, final int exCouponDays,
      final int settlementDays, final Calendar calendar, final DayCount dayCount, final YieldConvention yieldConvention, final int couponPerYear,
      final boolean isEOM, final LegalEntity issuer, final String repoType); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime maturityDate, final ZonedDateTime firstAccrualDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay,
      final YieldConvention yieldConvention, final boolean isEOM, final String issuer); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime maturityDate, final ZonedDateTime firstAccrualDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay,
      final YieldConvention yieldConvention, final boolean isEOM, final LegalEntity issuer); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime firstAccrualDate, final ZonedDateTime firstCouponDate, final ZonedDateTime maturityDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay,
      final YieldConvention yieldConvention, final boolean isEOM, final String issuer); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime firstAccrualDate, final ZonedDateTime firstCouponDate, final ZonedDateTime maturityDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay,
      final YieldConvention yieldConvention, final boolean isEOM, final LegalEntity issuer); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime firstAccrualDate, final ZonedDateTime firstCouponDate, final ZonedDateTime maturityDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final int exCouponDays, final Calendar calendar, final DayCount dayCount, final BusinessDayConvention businessDay,
      final YieldConvention yieldConvention, final boolean isEOM, final LegalEntity issuer); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime firstAccrualDate, final ZonedDateTime firstCouponDate, final ZonedDateTime maturityDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final double notional, final int exCouponDays, final Calendar calendar, final DayCount dayCount,
      final BusinessDayConvention businessDay, final YieldConvention yieldConvention, final boolean isEOM, final LegalEntity issuer); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime maturityDate, final ZonedDateTime firstAccrualDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final double notional, final int exCouponDays, final Calendar calendar,
      final DayCount dayCount, final BusinessDayConvention businessDay, final YieldConvention yieldConvention, final boolean isEOM, final String issuer,
      final String repoType); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime firstAccrualDate, final ZonedDateTime maturityDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final double notional, final int exCouponDays, final Calendar calendar,
      final DayCount dayCount, final BusinessDayConvention businessDay, final YieldConvention yieldConvention, final boolean isEOM, final LegalEntity issuer,
      final String repoType); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime maturityDate, final ZonedDateTime firstAccrualDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final double notional, final Calendar calendar, final DayCount dayCount,
      final BusinessDayConvention businessDay, final YieldConvention yieldConvention, final boolean isEOM, final String issuer, final String repoType); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime maturityDate, final ZonedDateTime firstAccrualDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final double notional, final Calendar calendar, final DayCount dayCount,
      final BusinessDayConvention businessDay, final YieldConvention yieldConvention, final boolean isEOM, final LegalEntity issuer, final String repoType); static BondFixedSecurityDefinition from(final Currency currency, final ZonedDateTime maturityDate, final ZonedDateTime firstAccrualDate,
      final Period paymentPeriod, final double rate, final int settlementDays, final double notional, final Calendar calendar, final DayCount dayCount,
      final BusinessDayConvention businessDay, final YieldConvention yieldConvention, final boolean isEOM); double accruedInterest(final ZonedDateTime date); YieldConvention getYieldConvention(); int getCouponPerYear(); boolean isEOM(); DayCount getDayCount(); @Override AnnuityCouponFixedDefinition getCoupons(); @Deprecated BondFixedSecurity toDerivative(final ZonedDateTime date, final ZonedDateTime settlementDate, final String... yieldCurveNames); @Override BondFixedSecurity toDerivative(final ZonedDateTime date); BondFixedSecurity toDerivative(final ZonedDateTime date, final ZonedDateTime settlementDate); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void longFirstCouponDE() { final double accrualFirstComputed = BOND_DE_SECURITY_DEFINITION.getCoupons().getNthPayment(0).getPaymentYearFraction(); assertTrue("Bond Fixed Security - long first coupon ActActICMA", accrualFirstComputed > 1); final double accrualFirstExpected = DAY_COUNT_ACTACTICMA.getAccruedInterest(BOND_START_DE, BOND_FIRSTCPN_DE, BOND_FIRSTCPN_DE, 1.0, COUPON_PER_YEAR_DE, StubType.LONG_START); assertEquals("Bond Fixed Security - long first coupon ActActICMA", accrualFirstExpected, accrualFirstComputed, TOLERANCE_PRICE); }
@Test public void longFirstCouponMon() { final double notional = 1000000; final double accrualFirstExpected = 40460.17; final double accrualFirstComputed = BOND_MON_SECURITY_DEFINITION.getCoupons().getNthPayment(0).getAmount(); assertEquals("Bond Fixed Security - XS0417033007 - accrued 1st cpn", accrualFirstExpected, accrualFirstComputed * notional, 1.0E-2); final double accrualSecondExpected = 26875.00; for (int loopcpn = 1; loopcpn < BOND_MON_SECURITY_DEFINITION.getCoupons().getNumberOfPayments(); loopcpn++) { assertEquals("Bond Fixed Security - XS0417033007 - accrued 1st cpn", accrualSecondExpected, BOND_MON_SECURITY_DEFINITION.getCoupons().getNthPayment(loopcpn).getAmount() * notional, 1.0E-2); } }