public virtual void test_builder()
        {
            FixedRateCalculation test = FixedRateCalculation.builder().dayCount(ACT_365F).rate(ValueSchedule.of(0.025d)).initialStub(FixedRateStubCalculation.ofFixedRate(0.1d)).finalStub(FixedRateStubCalculation.ofFixedRate(0.2d)).build();

            assertEquals(test.Rate, ValueSchedule.of(0.025d));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.InitialStub, FixedRateStubCalculation.ofFixedRate(0.1d));
            assertEquals(test.FinalStub, FixedRateStubCalculation.ofFixedRate(0.2d));
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            FixedRateStubCalculation test = FixedRateStubCalculation.ofFixedRate(0.025d);

            coverImmutableBean(test);
            FixedRateStubCalculation test2 = FixedRateStubCalculation.ofKnownAmount(GBP_P1000);

            coverBeanEquals(test, test2);
        }
        //-------------------------------------------------------------------------
        public virtual void test_ofFixedRate()
        {
            FixedRateStubCalculation test = FixedRateStubCalculation.ofFixedRate(0.025d);

            assertEquals(test.FixedRate, double?.of(0.025d));
            assertEquals(test.KnownAmount, null);
            assertEquals(test.FixedRate, true);
            assertEquals(test.KnownAmount, false);
        }
        public virtual void test_serialization()
        {
            FixedRateStubCalculation test = FixedRateStubCalculation.ofFixedRate(0.025d);

            assertSerialization(test);
        }
        public virtual void test_createRateComputation_fixedRate()
        {
            FixedRateStubCalculation test = FixedRateStubCalculation.ofFixedRate(0.025d);

            assertEquals(test.createRateComputation(3d), FixedRateComputation.of(0.025d));
        }
        public virtual void test_resolve_knownAmountStub()
        {
            // test case
            CurrencyAmount         knownAmount = CurrencyAmount.of(GBP, 150d);
            RateCalculationSwapLeg test        = RateCalculationSwapLeg.builder().payReceive(PAY).accrualSchedule(PeriodicSchedule.builder().startDate(DATE_02_03).endDate(DATE_04_03).firstRegularStartDate(DATE_02_05).lastRegularEndDate(DATE_03_05).frequency(P1M).stubConvention(StubConvention.BOTH).businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO)).build()).paymentSchedule(PaymentSchedule.builder().paymentFrequency(P1M).paymentDateOffset(PLUS_TWO_DAYS).build()).notionalSchedule(NotionalSchedule.of(GBP, 1000d)).calculation(FixedRateCalculation.builder().dayCount(ACT_365F).rate(ValueSchedule.of(0.025d)).initialStub(FixedRateStubCalculation.ofKnownAmount(knownAmount)).finalStub(FixedRateStubCalculation.ofFixedRate(0.1d)).build()).build();
            // expected
            KnownAmountNotionalSwapPaymentPeriod pp1 = KnownAmountNotionalSwapPaymentPeriod.builder().payment(Payment.of(knownAmount, DATE_02_07)).startDate(DATE_02_03).endDate(DATE_02_05).unadjustedStartDate(DATE_02_03).notionalAmount(CurrencyAmount.of(GBP, -1000d)).build();
            RatePaymentPeriod rpp2 = RatePaymentPeriod.builder().paymentDate(DATE_03_07).accrualPeriods(RateAccrualPeriod.builder().startDate(DATE_02_05).endDate(DATE_03_05).yearFraction(ACT_365F.yearFraction(DATE_02_05, DATE_03_05)).rateComputation(FixedRateComputation.of(0.025d)).build()).dayCount(ACT_365F).currency(GBP).notional(-1000d).build();
            RatePaymentPeriod rpp3 = RatePaymentPeriod.builder().paymentDate(DATE_04_07).accrualPeriods(RateAccrualPeriod.builder().startDate(DATE_03_05).endDate(DATE_04_03).unadjustedEndDate(DATE_04_03).yearFraction(ACT_365F.yearFraction(DATE_03_05, DATE_04_03)).rateComputation(FixedRateComputation.of(0.1d)).build()).dayCount(ACT_365F).currency(GBP).notional(-1000d).build();

            // assertion
            assertEquals(test.resolve(REF_DATA), ResolvedSwapLeg.builder().type(FIXED).payReceive(PAY).paymentPeriods(pp1, rpp2, rpp3).build());
        }