### Question:
RatePeriodSwapLeg implements SwapLeg, ImmutableBean, Serializable { public static RatePeriodSwapLeg.Builder builder() { return new RatePeriodSwapLeg.Builder(); } @ImmutableConstructor private  RatePeriodSwapLeg(
      SwapLegType type,
      PayReceive payReceive,
      List<RatePaymentPeriod> paymentPeriods,
      boolean initialExchange,
      boolean intermediateExchange,
      boolean finalExchange,
      List<SwapPaymentEvent> paymentEvents,
      BusinessDayAdjustment paymentBusinessDayAdjustment); @Override AdjustableDate getStartDate(); @Override AdjustableDate getEndDate(); @Override Currency getCurrency(); @Override void collectCurrencies(ImmutableSet.Builder<Currency> builder); @Override void collectIndices(ImmutableSet.Builder<Index> builder); @Override ResolvedSwapLeg resolve(ReferenceData refData); static RatePeriodSwapLeg.Meta meta(); static RatePeriodSwapLeg.Builder builder(); @Override RatePeriodSwapLeg.Meta metaBean(); @Override SwapLegType getType(); @Override PayReceive getPayReceive(); ImmutableList<RatePaymentPeriod> getPaymentPeriods(); boolean isInitialExchange(); boolean isIntermediateExchange(); boolean isFinalExchange(); ImmutableList<SwapPaymentEvent> getPaymentEvents(); BusinessDayAdjustment getPaymentBusinessDayAdjustment(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_builder_invalidMixedCurrency() { assertThatIllegalArgumentException() .isThrownBy(() -> RatePeriodSwapLeg.builder() .type(IBOR) .payReceive(RECEIVE) .paymentPeriods(RPP3) .paymentEvents(NOTIONAL_EXCHANGE) .build()); }
@Test public void coverage() { RatePeriodSwapLeg test = RatePeriodSwapLeg.builder() .type(IBOR) .payReceive(RECEIVE) .paymentPeriods(RPP1) .paymentEvents(NOTIONAL_EXCHANGE) .paymentBusinessDayAdjustment(FOLLOWING_GBLO) .initialExchange(true) .intermediateExchange(true) .finalExchange(true) .build(); coverImmutableBean(test); RatePeriodSwapLeg test2 = RatePeriodSwapLeg.builder() .type(FIXED) .payReceive(PAY) .paymentPeriods(RPP2) .build(); coverBeanEquals(test, test2); }
@Test public void test_serialization() { RatePeriodSwapLeg test = RatePeriodSwapLeg.builder() .type(IBOR) .payReceive(RECEIVE) .paymentPeriods(RPP1) .paymentEvents(NOTIONAL_EXCHANGE) .build(); assertSerialization(test); }