public virtual void test_expand_rateCutOffDays_threeAccrualsInPaymentPeriod()
        {
            OvernightRateCalculation          test    = OvernightRateCalculation.builder().dayCount(ACT_365F).index(GBP_SONIA).rateCutOffDays(2).build();
            RateAccrualPeriod                 rap1    = RateAccrualPeriod.builder(ACCRUAL1).yearFraction(ACCRUAL1.yearFraction(ACT_365F, ACCRUAL_SCHEDULE)).rateComputation(OvernightCompoundedRateComputation.of(GBP_SONIA, DATE_01_06, DATE_02_05, 0, REF_DATA)).build();
            RateAccrualPeriod                 rap2    = RateAccrualPeriod.builder(ACCRUAL2).yearFraction(ACCRUAL2.yearFraction(ACT_365F, ACCRUAL_SCHEDULE)).rateComputation(OvernightCompoundedRateComputation.of(GBP_SONIA, DATE_02_05, DATE_03_05, 0, REF_DATA)).build();
            RateAccrualPeriod                 rap3    = RateAccrualPeriod.builder(ACCRUAL3).yearFraction(ACCRUAL3.yearFraction(ACT_365F, ACCRUAL_SCHEDULE)).rateComputation(OvernightCompoundedRateComputation.of(GBP_SONIA, DATE_03_05, DATE_04_07, 2, REF_DATA)).build();
            ImmutableList <RateAccrualPeriod> periods = test.createAccrualPeriods(ACCRUAL_SCHEDULE, PAYMENT_SCHEDULE, REF_DATA);

            assertEquals(periods, ImmutableList.of(rap1, rap2, rap3));
        }
        public virtual void test_expand_gearingSpreadEverythingElse()
        {
            OvernightRateCalculation          test    = OvernightRateCalculation.builder().dayCount(ACT_365F).index(GBP_SONIA).accrualMethod(AVERAGED).negativeRateMethod(NOT_NEGATIVE).rateCutOffDays(2).gearing(ValueSchedule.of(1d, ValueStep.of(2, ValueAdjustment.ofReplace(2d)))).spread(ValueSchedule.of(0d, ValueStep.of(1, ValueAdjustment.ofReplace(-0.025d)))).build();
            RateAccrualPeriod                 rap1    = RateAccrualPeriod.builder(ACCRUAL1).yearFraction(ACCRUAL1.yearFraction(ACT_365F, ACCRUAL_SCHEDULE)).rateComputation(OvernightAveragedRateComputation.of(GBP_SONIA, DATE_01_06, DATE_02_05, 0, REF_DATA)).negativeRateMethod(NOT_NEGATIVE).build();
            RateAccrualPeriod                 rap2    = RateAccrualPeriod.builder(ACCRUAL2).yearFraction(ACCRUAL2.yearFraction(ACT_365F, ACCRUAL_SCHEDULE)).rateComputation(OvernightAveragedRateComputation.of(GBP_SONIA, DATE_02_05, DATE_03_05, 0, REF_DATA)).negativeRateMethod(NOT_NEGATIVE).spread(-0.025d).build();
            RateAccrualPeriod                 rap3    = RateAccrualPeriod.builder(ACCRUAL3).yearFraction(ACCRUAL3.yearFraction(ACT_365F, ACCRUAL_SCHEDULE)).rateComputation(OvernightAveragedRateComputation.of(GBP_SONIA, DATE_03_05, DATE_04_07, 2, REF_DATA)).negativeRateMethod(NOT_NEGATIVE).gearing(2d).spread(-0.025d).build();
            ImmutableList <RateAccrualPeriod> periods = test.createAccrualPeriods(ACCRUAL_SCHEDULE, PAYMENT_SCHEDULE, REF_DATA);

            assertEquals(periods, ImmutableList.of(rap1, rap2, rap3));
        }
        public virtual void test_expand_tomNext()
        {
            OvernightRateCalculation          test    = OvernightRateCalculation.builder().dayCount(ACT_360).index(CHF_TOIS).build();
            RateAccrualPeriod                 rap1    = RateAccrualPeriod.builder(ACCRUAL1).yearFraction(ACCRUAL1.yearFraction(ACT_360, ACCRUAL_SCHEDULE)).rateComputation(OvernightCompoundedRateComputation.of(CHF_TOIS, DATE_01_06, DATE_02_05, 0, REF_DATA)).build();
            RateAccrualPeriod                 rap2    = RateAccrualPeriod.builder(ACCRUAL2).yearFraction(ACCRUAL2.yearFraction(ACT_360, ACCRUAL_SCHEDULE)).rateComputation(OvernightCompoundedRateComputation.of(CHF_TOIS, DATE_02_05, DATE_03_05, 0, REF_DATA)).build();
            RateAccrualPeriod                 rap3    = RateAccrualPeriod.builder(ACCRUAL3).yearFraction(ACCRUAL3.yearFraction(ACT_360, ACCRUAL_SCHEDULE)).rateComputation(OvernightCompoundedRateComputation.of(CHF_TOIS, DATE_03_05, DATE_04_07, 0, REF_DATA)).build();
            ImmutableList <RateAccrualPeriod> periods = test.createAccrualPeriods(ACCRUAL_SCHEDULE, ACCRUAL_SCHEDULE, REF_DATA);

            assertEquals(periods, ImmutableList.of(rap1, rap2, rap3));
        }