### Question:
ResolvedFxSingleBarrierOption implements ResolvedProduct, ImmutableBean, Serializable { public static ResolvedFxSingleBarrierOption of( ResolvedFxVanillaOption underlyingOption, Barrier barrier, CurrencyAmount rebate) { return new ResolvedFxSingleBarrierOption(underlyingOption, barrier, rebate); } private  ResolvedFxSingleBarrierOption(
      ResolvedFxVanillaOption underlyingOption,
      Barrier barrier,
      CurrencyAmount rebate); static ResolvedFxSingleBarrierOption of(
      ResolvedFxVanillaOption underlyingOption,
      Barrier barrier,
      CurrencyAmount rebate); static ResolvedFxSingleBarrierOption of(ResolvedFxVanillaOption underlyingOption, Barrier barrier); CurrencyPair getCurrencyPair(); static ResolvedFxSingleBarrierOption.Meta meta(); @Override ResolvedFxSingleBarrierOption.Meta metaBean(); ResolvedFxVanillaOption getUnderlyingOption(); Barrier getBarrier(); Optional<CurrencyAmount> getRebate(); @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(() -> ResolvedFxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, negative)); CurrencyAmount other = CurrencyAmount.of(GBP, 5.0e4); assertThatIllegalArgumentException() .isThrownBy(() -> ResolvedFxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, other)); }
@Test public void coverage() { ResolvedFxSingleBarrierOption test1 = ResolvedFxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, REBATE); ResolvedFxSingleBarrierOption test2 = ResolvedFxSingleBarrierOption.of( ResolvedFxVanillaOption.builder() .longShort(SHORT) .expiry(EXPIRY_DATE_TIME) .underlying(FX) .build(), SimpleConstantContinuousBarrier.of(BarrierType.UP, KnockType.KNOCK_IN, 1.5)); coverImmutableBean(test1); coverBeanEquals(test1, test2); }
@Test public void test_serialization() { ResolvedFxSingleBarrierOption test = ResolvedFxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, REBATE); assertSerialization(test); }