### Question:
ResolvedSwapLeg implements ImmutableBean, Serializable { public static ResolvedSwapLeg.Builder builder() { return new ResolvedSwapLeg.Builder(); } @ImmutableConstructor private  ResolvedSwapLeg(
      SwapLegType type,
      PayReceive payReceive,
      List<? extends SwapPaymentPeriod> paymentPeriods,
      List<? extends SwapPaymentEvent> paymentEvents);   ResolvedSwapLeg(
      SwapLegType type,
      PayReceive payReceive,
      List<? extends SwapPaymentPeriod> paymentPeriods,
      List<? extends SwapPaymentEvent> paymentEvents,
      Currency currency); LocalDate getStartDate(); LocalDate getEndDate(); Currency getCurrency(); Optional<SwapPaymentPeriod> findPaymentPeriod(LocalDate date); void collectIndices(ImmutableSet.Builder<Index> builder); Optional<CurrencyAmount> findNotional(LocalDate date); static ResolvedSwapLeg.Meta meta(); static ResolvedSwapLeg.Builder builder(); @Override ResolvedSwapLeg.Meta metaBean(); SwapLegType getType(); PayReceive getPayReceive(); ImmutableList<SwapPaymentPeriod> getPaymentPeriods(); ImmutableList<SwapPaymentEvent> getPaymentEvents(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_builder_invalidMixedCurrency() { assertThatIllegalArgumentException() .isThrownBy(() -> ResolvedSwapLeg.builder() .type(IBOR) .payReceive(RECEIVE) .paymentPeriods(RPP3) .paymentEvents(NOTIONAL_EXCHANGE) .build()); }
@Test public void coverage() { ResolvedSwapLeg test = ResolvedSwapLeg.builder() .type(IBOR) .payReceive(RECEIVE) .paymentPeriods(RPP1) .paymentEvents(NOTIONAL_EXCHANGE) .build(); coverImmutableBean(test); ResolvedSwapLeg test2 = ResolvedSwapLeg.builder() .type(FIXED) .payReceive(PAY) .paymentPeriods(RPP2) .build(); coverBeanEquals(test, test2); }
@Test public void test_serialization() { ResolvedSwapLeg test = ResolvedSwapLeg.builder() .type(IBOR) .payReceive(RECEIVE) .paymentPeriods(RPP1) .paymentEvents(NOTIONAL_EXCHANGE) .build(); assertSerialization(test); }