### Question:
InflationRateCalculation implements RateCalculation, ImmutableBean, Serializable { public static InflationRateCalculation.Builder builder() { return new InflationRateCalculation.Builder(); } private  InflationRateCalculation(
      PriceIndex index,
      Period lag,
      PriceIndexCalculationMethod indexCalculationMethod,
      Double firstIndexValue,
      ValueSchedule gearing); static InflationRateCalculation of(
      PriceIndex index,
      int monthLag,
      PriceIndexCalculationMethod indexCalculationMethod); static InflationRateCalculation of(
      PriceIndex index,
      int monthLag,
      PriceIndexCalculationMethod indexCalculationMethod,
      double firstIndexValue); @Override SwapLegType getType(); @Override DayCount getDayCount(); @Override void collectCurrencies(ImmutableSet.Builder<Currency> builder); @Override void collectIndices(ImmutableSet.Builder<Index> builder); @Override ImmutableList<RateAccrualPeriod> createAccrualPeriods(
      Schedule accrualSchedule,
      Schedule paymentSchedule,
      ReferenceData refData); RateComputation createRateComputation(LocalDate endDate); static InflationRateCalculation.Meta meta(); static InflationRateCalculation.Builder builder(); @Override InflationRateCalculation.Meta metaBean(); PriceIndex getIndex(); Period getLag(); PriceIndexCalculationMethod getIndexCalculationMethod(); OptionalDouble getFirstIndexValue(); Optional<ValueSchedule> getGearing(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_builder_missing_index() { assertThatIllegalArgumentException() .isThrownBy(() -> InflationRateCalculation.builder().build()); }
@Test public void test_builder_badLag() { assertThatIllegalArgumentException() .isThrownBy(() -> InflationRateCalculation.builder() .index(GB_HICP) .lag(Period.ZERO) .build()); assertThatIllegalArgumentException() .isThrownBy(() -> InflationRateCalculation.builder() .index(GB_HICP) .lag(Period.ofMonths(-1)) .build()); }
@Test public void coverage() { InflationRateCalculation test1 = InflationRateCalculation.builder() .index(CH_CPI) .lag(Period.ofMonths(3)) .indexCalculationMethod(MONTHLY) .build(); coverImmutableBean(test1); InflationRateCalculation test2 = InflationRateCalculation.builder() .index(GB_HICP) .lag(Period.ofMonths(4)) .indexCalculationMethod(INTERPOLATED) .gearing(GEARING) .build(); coverBeanEquals(test1, test2); }
@Test public void test_serialization() { InflationRateCalculation test1 = InflationRateCalculation.builder() .index(CH_CPI) .lag(Period.ofMonths(3)) .indexCalculationMethod(MONTHLY) .build(); assertSerialization(test1); }