public virtual void test_builder_fail()
 {
     // negative settlement date offset
     assertThrowsIllegalArg(() => CapitalIndexedBond.builder().securityId(SECURITY_ID).notional(NOTIONAL).currency(USD).dayCount(ACT_ACT_ISDA).rateCalculation(RATE_CALC).exCouponPeriod(EX_COUPON).legalEntityId(LEGAL_ENTITY).yieldConvention(US_IL_REAL).settlementDateOffset(DaysAdjustment.ofBusinessDays(-2, USNY)).accrualSchedule(SCHEDULE).build());
     // positive ex-coupon days
     assertThrowsIllegalArg(() => CapitalIndexedBond.builder().securityId(SECURITY_ID).notional(NOTIONAL).currency(USD).dayCount(ACT_ACT_ISDA).rateCalculation(RATE_CALC).exCouponPeriod(DaysAdjustment.ofCalendarDays(7, BusinessDayAdjustment.of(BusinessDayConventions.FOLLOWING, USNY))).legalEntityId(LEGAL_ENTITY).yieldConvention(US_IL_REAL).settlementDateOffset(SETTLE_OFFSET).accrualSchedule(SCHEDULE).build());
 }
        public virtual void test_builder_min()
        {
            CapitalIndexedBond test = CapitalIndexedBond.builder().securityId(SECURITY_ID).notional(NOTIONAL).currency(USD).dayCount(ACT_ACT_ISDA).rateCalculation(RATE_CALC).legalEntityId(LEGAL_ENTITY).yieldConvention(US_IL_REAL).settlementDateOffset(SETTLE_OFFSET).accrualSchedule(SCHEDULE).build();

            assertEquals(test.SecurityId, SECURITY_ID);
            assertEquals(test.Currency, USD);
            assertEquals(test.DayCount, ACT_ACT_ISDA);
            assertEquals(test.ExCouponPeriod, DaysAdjustment.NONE);
            assertEquals(test.LegalEntityId, LEGAL_ENTITY);
            assertEquals(test.Notional, NOTIONAL);
            assertEquals(test.AccrualSchedule, SCHEDULE);
            assertEquals(test.RateCalculation, RATE_CALC);
            assertEquals(test.SettlementDateOffset, SETTLE_OFFSET);
            assertEquals(test.YieldConvention, US_IL_REAL);
        }
 internal static CapitalIndexedBond sut2()
 {
     return(CapitalIndexedBond.builder().securityId(SECURITY_ID2).notional(5.0e7).currency(GBP).dayCount(NL_365).rateCalculation(InflationRateCalculation.builder().index(GB_RPI).lag(Period.ofMonths(2)).indexCalculationMethod(INTERPOLATED).firstIndexValue(124.556).build()).exCouponPeriod(EX_COUPON).legalEntityId(LegalEntityId.of("OG-Ticker", "US-Govt-1")).yieldConvention(GB_IL_FLOAT).settlementDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO)).accrualSchedule(PeriodicSchedule.of(START, END, FREQUENCY, BusinessDayAdjustment.of(BusinessDayConventions.FOLLOWING, GBLO), StubConvention.NONE, RollConventions.NONE)).build());
 }
 internal static CapitalIndexedBond sut1()
 {
     return(CapitalIndexedBond.builder().securityId(SECURITY_ID).notional(NOTIONAL).currency(USD).dayCount(ACT_ACT_ISDA).rateCalculation(RATE_CALC).exCouponPeriod(EX_COUPON).legalEntityId(LEGAL_ENTITY).yieldConvention(GB_IL_FLOAT).settlementDateOffset(SETTLE_OFFSET).accrualSchedule(SCHEDULE).build());
 }