public void test_expandAllSpecified() {
   OvernightRateSwapLegConvention test =
       OvernightRateSwapLegConvention.builder()
           .index(GBP_SONIA)
           .accrualMethod(COMPOUNDED)
           .rateCutOffDays(2)
           .currency(USD)
           .dayCount(ACT_360)
           .accrualFrequency(P6M)
           .accrualBusinessDayAdjustment(BDA_FOLLOW)
           .startDateBusinessDayAdjustment(BDA_FOLLOW)
           .endDateBusinessDayAdjustment(BDA_FOLLOW)
           .stubConvention(LONG_INITIAL)
           .rollConvention(RollConventions.EOM)
           .paymentFrequency(P6M)
           .paymentDateOffset(PLUS_TWO_DAYS)
           .compoundingMethod(CompoundingMethod.FLAT)
           .build();
   assertEquals(test.getIndex(), GBP_SONIA);
   assertEquals(test.getAccrualMethod(), COMPOUNDED);
   assertEquals(test.getRateCutOffDays(), 2);
   assertEquals(test.getCurrency(), USD);
   assertEquals(test.getDayCount(), ACT_360);
   assertEquals(test.getAccrualFrequency(), P6M);
   assertEquals(test.getAccrualBusinessDayAdjustment(), BDA_FOLLOW);
   assertEquals(test.getStartDateBusinessDayAdjustment(), BDA_FOLLOW);
   assertEquals(test.getEndDateBusinessDayAdjustment(), BDA_FOLLOW);
   assertEquals(test.getStubConvention(), StubConvention.LONG_INITIAL);
   assertEquals(test.getRollConvention(), RollConventions.EOM);
   assertEquals(test.getPaymentFrequency(), P6M);
   assertEquals(test.getPaymentDateOffset(), PLUS_TWO_DAYS);
   assertEquals(test.getCompoundingMethod(), CompoundingMethod.FLAT);
 }
 // -------------------------------------------------------------------------
 public void test_of() {
   OvernightRateSwapLegConvention test = OvernightRateSwapLegConvention.of(GBP_SONIA, P12M, 2);
   assertEquals(test.getIndex(), GBP_SONIA);
   assertEquals(test.getAccrualMethod(), COMPOUNDED);
   assertEquals(test.getRateCutOffDays(), 0);
   assertEquals(test.getCurrency(), GBP);
   assertEquals(test.getDayCount(), ACT_365F);
   assertEquals(test.getAccrualFrequency(), P12M);
   assertEquals(test.getAccrualBusinessDayAdjustment(), BDA_MOD_FOLLOW);
   assertEquals(test.getStartDateBusinessDayAdjustment(), BDA_MOD_FOLLOW);
   assertEquals(test.getEndDateBusinessDayAdjustment(), BDA_MOD_FOLLOW);
   assertEquals(test.getStubConvention(), StubConvention.SHORT_INITIAL);
   assertEquals(test.getRollConvention(), RollConventions.NONE);
   assertEquals(test.getPaymentFrequency(), P12M);
   assertEquals(
       test.getPaymentDateOffset(),
       DaysAdjustment.ofBusinessDays(2, GBP_SONIA.getFixingCalendar()));
   assertEquals(test.getCompoundingMethod(), CompoundingMethod.NONE);
 }