### Question:
RatePaymentPeriod implements NotionalPaymentPeriod, ImmutableBean, Serializable { public static RatePaymentPeriod.Builder builder() { return new RatePaymentPeriod.Builder(); } RatePaymentPeriod(
      LocalDate paymentDate,
      List<RateAccrualPeriod> accrualPeriods,
      DayCount dayCount,
      Currency currency,
      FxReset fxReset,
      double notional,
      CompoundingMethod compoundingMethod); @Override LocalDate getStartDate(); @Override LocalDate getEndDate(); @Override CurrencyAmount getNotionalAmount(); @Override Optional<FxIndexObservation> getFxResetObservation(); boolean isCompoundingApplicable(); @Override RatePaymentPeriod adjustPaymentDate(TemporalAdjuster adjuster); @Override void collectIndices(ImmutableSet.Builder<Index> builder); static RatePaymentPeriod.Meta meta(); static RatePaymentPeriod.Builder builder(); @Override RatePaymentPeriod.Meta metaBean(); @Override LocalDate getPaymentDate(); ImmutableList<RateAccrualPeriod> getAccrualPeriods(); DayCount getDayCount(); @Override Currency getCurrency(); Optional<FxReset> getFxReset(); double getNotional(); CompoundingMethod getCompoundingMethod(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_builder_badFxReset() { assertThatIllegalArgumentException() .isThrownBy(() -> RatePaymentPeriod.builder() .paymentDate(DATE_2014_10_01) .accrualPeriods(RAP1, RAP2) .dayCount(ACT_365F) .currency(USD) .fxReset(FX_RESET_USD) .notional(1000d) .compoundingMethod(CompoundingMethod.NONE) .build()); assertThatIllegalArgumentException() .isThrownBy(() -> RatePaymentPeriod.builder() .paymentDate(DATE_2014_10_01) .accrualPeriods(RAP1, RAP2) .dayCount(ACT_365F) .currency(EUR) .fxReset(FX_RESET_USD) .notional(1000d) .compoundingMethod(CompoundingMethod.NONE) .build()); }
@Test public void coverage() { RatePaymentPeriod test = RatePaymentPeriod.builder() .paymentDate(DATE_2014_10_01) .accrualPeriods(RAP1, RAP2) .dayCount(ACT_365F) .currency(GBP) .fxReset(FX_RESET_USD) .notional(1000d) .compoundingMethod(CompoundingMethod.STRAIGHT) .build(); coverImmutableBean(test); RatePaymentPeriod test2 = RatePaymentPeriod.builder() .paymentDate(DATE_2014_09_30) .accrualPeriods(RAP1) .dayCount(ACT_360) .currency(USD) .notional(2000d) .compoundingMethod(CompoundingMethod.NONE) .build(); coverBeanEquals(test, test2); }
@Test public void test_serialization() { RatePaymentPeriod test = RatePaymentPeriod.builder() .paymentDate(DATE_2014_10_01) .accrualPeriods(RAP1, RAP2) .dayCount(ACT_365F) .currency(GBP) .notional(1000d) .compoundingMethod(CompoundingMethod.STRAIGHT) .build(); assertSerialization(test); }