### Question:
FxSingleBarrierOption implements FxProduct, Resolvable<ResolvedFxSingleBarrierOption>, ImmutableBean, Serializable { public static FxSingleBarrierOption of(FxVanillaOption underlyingOption, Barrier barrier, CurrencyAmount rebate) { return new FxSingleBarrierOption(underlyingOption, barrier, rebate); } private  FxSingleBarrierOption(
      FxVanillaOption underlyingOption,
      Barrier barrier,
      CurrencyAmount rebate); static FxSingleBarrierOption of(FxVanillaOption underlyingOption, Barrier barrier, CurrencyAmount rebate); static FxSingleBarrierOption of(FxVanillaOption underlyingOption, Barrier barrier); @Override CurrencyPair getCurrencyPair(); @Override ResolvedFxSingleBarrierOption resolve(ReferenceData refData); static FxSingleBarrierOption.Meta meta(); static FxSingleBarrierOption.Builder builder(); @Override FxSingleBarrierOption.Meta metaBean(); FxVanillaOption getUnderlyingOption(); Barrier getBarrier(); Optional<CurrencyAmount> getRebate(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_of_fail() { CurrencyAmount negative = CurrencyAmount.of(USD, -5.0e4); assertThatIllegalArgumentException() .isThrownBy(() -> FxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, negative)); CurrencyAmount other = CurrencyAmount.of(GBP, 5.0e4); assertThatIllegalArgumentException() .isThrownBy(() -> FxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, other)); }
@Test public void test_serialization() { FxSingleBarrierOption test = FxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, REBATE); assertSerialization(test); }