### Question:
ResolvedIborCapFloorLeg implements ImmutableBean, Serializable { public static ResolvedIborCapFloorLeg.Builder builder() { return new ResolvedIborCapFloorLeg.Builder(); } @ImmutableConstructor private  ResolvedIborCapFloorLeg(
      PayReceive payReceive,
      List<IborCapletFloorletPeriod> capletFloorletPeriods); LocalDate getStartDate(); LocalDate getEndDate(); ZonedDateTime getFinalFixingDateTime(); IborCapletFloorletPeriod getFinalPeriod(); Currency getCurrency(); IborIndex getIndex(); static ResolvedIborCapFloorLeg.Meta meta(); static ResolvedIborCapFloorLeg.Builder builder(); @Override ResolvedIborCapFloorLeg.Meta metaBean(); PayReceive getPayReceive(); ImmutableList<IborCapletFloorletPeriod> getCapletFloorletPeriods(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_builder_fail() { IborCapletFloorletPeriod periodGbp = IborCapletFloorletPeriod.builder() .caplet(STRIKE) .notional(NOTIONAL) .currency(GBP) .startDate(LocalDate.of(2011, 6, 17)) .endDate(LocalDate.of(2011, 9, 19)) .unadjustedStartDate(LocalDate.of(2011, 6, 17)) .unadjustedEndDate(LocalDate.of(2011, 9, 17)) .paymentDate(LocalDate.of(2011, 9, 21)) .iborRate(IborRateComputation.of(EUR_EURIBOR_3M, LocalDate.of(2011, 9, 15), REF_DATA)) .yearFraction(0.2611) .build(); assertThatIllegalArgumentException() .isThrownBy(() -> ResolvedIborCapFloorLeg.builder() .capletFloorletPeriods(PERIOD_1, periodGbp) .payReceive(RECEIVE) .build()); IborCapletFloorletPeriod periodLibor = IborCapletFloorletPeriod.builder() .caplet(STRIKE) .notional(NOTIONAL) .currency(EUR) .startDate(LocalDate.of(2011, 6, 17)) .endDate(LocalDate.of(2011, 9, 19)) .unadjustedStartDate(LocalDate.of(2011, 6, 17)) .unadjustedEndDate(LocalDate.of(2011, 9, 17)) .paymentDate(LocalDate.of(2011, 9, 21)) .iborRate(IborRateComputation.of(GBP_LIBOR_3M, LocalDate.of(2011, 9, 15), REF_DATA)) .yearFraction(0.2611) .build(); assertThatIllegalArgumentException() .isThrownBy(() -> ResolvedIborCapFloorLeg.builder() .capletFloorletPeriods(PERIOD_1, periodLibor) .payReceive(RECEIVE) .build()); }
@Test public void coverage() { ResolvedIborCapFloorLeg test1 = ResolvedIborCapFloorLeg.builder() .capletFloorletPeriods(PERIOD_1, PERIOD_2, PERIOD_3, PERIOD_4) .payReceive(RECEIVE) .build(); coverImmutableBean(test1); ResolvedIborCapFloorLeg test2 = ResolvedIborCapFloorLeg.builder() .capletFloorletPeriods(PERIOD_2, PERIOD_3) .payReceive(PAY) .build(); coverBeanEquals(test1, test2); }
@Test public void test_serialization() { ResolvedIborCapFloorLeg test = ResolvedIborCapFloorLeg.builder() .capletFloorletPeriods(PERIOD_1, PERIOD_2, PERIOD_3, PERIOD_4) .payReceive(RECEIVE) .build(); assertSerialization(test); }