public virtual void test_builder_inverse()
        {
            FxRate fxRate = FxRate.of(USD, GBP, 0.7d);
            FxNdf  test   = FxNdf.builder().agreedFxRate(fxRate).settlementCurrencyNotional(CURRENCY_NOTIONAL).index(GBP_USD_WM).paymentDate(PAYMENT_DATE).build();

            assertEquals(test.AgreedFxRate, fxRate);
            assertEquals(test.Index, GBP_USD_WM);
            assertEquals(test.NonDeliverableCurrency, USD);
            assertEquals(test.SettlementCurrencyNotional, CURRENCY_NOTIONAL);
            assertEquals(test.PaymentDate, PAYMENT_DATE);
            assertEquals(test.SettlementCurrency, GBP);
        }
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            FxNdf test = FxNdf.builder().agreedFxRate(FX_RATE).index(GBP_USD_WM).settlementCurrencyNotional(CURRENCY_NOTIONAL).paymentDate(PAYMENT_DATE).build();

            assertEquals(test.AgreedFxRate, FX_RATE);
            assertEquals(test.Index, GBP_USD_WM);
            assertEquals(test.NonDeliverableCurrency, USD);
            assertEquals(test.SettlementCurrencyNotional, CURRENCY_NOTIONAL);
            assertEquals(test.PaymentDate, PAYMENT_DATE);
            assertEquals(test.SettlementCurrency, GBP);
            assertEquals(test.CrossCurrency, true);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(GBP));
            assertEquals(test.allCurrencies(), ImmutableSet.of(GBP, USD));
        }
 public virtual void test_builder_wrongCurrency()
 {
     assertThrowsIllegalArg(() => FxNdf.builder().agreedFxRate(FX_RATE).settlementCurrencyNotional(CurrencyAmount.of(EUR, NOTIONAL)).index(GBP_USD_WM).paymentDate(PAYMENT_DATE).build());
 }
        public virtual void test_builder_wrongRate()
        {
            FxRate fxRate = FxRate.of(GBP, EUR, 1.1d);

            assertThrowsIllegalArg(() => FxNdf.builder().agreedFxRate(fxRate).settlementCurrencyNotional(CURRENCY_NOTIONAL).index(GBP_USD_WM).paymentDate(PAYMENT_DATE).build());
        }
 internal static FxNdf sut2()
 {
     return(FxNdf.builder().agreedFxRate(FX_RATE).settlementCurrencyNotional(CurrencyAmount.of(USD, -NOTIONAL)).index(GBP_USD_WM).paymentDate(PAYMENT_DATE).build());
 }