public virtual void test_jodaSerialization()
        {
            ImmutableMap <Currency, CurveId> discounts = ImmutableMap.of(USD, CURVE_ID_DSC);
            ImmutableMap <Index, CurveId>    forwards  = ImmutableMap.of(USD_LIBOR_3M, CURVE_ID_FWD);
            DefaultRatesMarketDataLookup     test      = DefaultRatesMarketDataLookup.of(discounts, forwards, ObservableSource.NONE, FxRateLookup.ofRates());
            string xml = JodaBeanSer.PRETTY.xmlWriter().write(test);

            assertEquals(xml.Contains("<entry key=\"USD-LIBOR-3M\">"), true);
            assertEquals(xml.Contains("<fixingDateOffset>"), false);
            assertEquals(xml.Contains("<effectiveDateOffset>"), false);
        }
        public virtual void test_serialization()
        {
            ImmutableMap <Currency, CurveId> discounts = ImmutableMap.of(USD, CURVE_ID_DSC);
            ImmutableMap <Index, CurveId>    forwards  = ImmutableMap.of(USD_LIBOR_3M, CURVE_ID_FWD);
            DefaultRatesMarketDataLookup     test      = DefaultRatesMarketDataLookup.of(discounts, forwards, ObservableSource.NONE, FxRateLookup.ofRates());

            assertSerialization(test);
            Curve curve = ConstantCurve.of(Curves.discountFactors("DSC", ACT_360), 0.99);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<? extends com.opengamma.strata.data.MarketDataId<?>, ?> valuesMap = com.google.common.collect.ImmutableMap.of(CURVE_ID_DSC, curve, CURVE_ID_FWD, curve);
            IDictionary <MarketDataId <object>, ?> valuesMap = ImmutableMap.of(CURVE_ID_DSC, curve, CURVE_ID_FWD, curve);
            MarketData md = MarketData.of(date(2016, 6, 30), valuesMap);

            assertSerialization(test.marketDataView(md));
            assertSerialization(test.ratesProvider(md));
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ImmutableMap <Currency, CurveId> discounts = ImmutableMap.of(USD, CURVE_ID_DSC);
            ImmutableMap <Index, CurveId>    forwards  = ImmutableMap.of(USD_LIBOR_3M, CURVE_ID_FWD);
            DefaultRatesMarketDataLookup     test      = DefaultRatesMarketDataLookup.of(discounts, forwards, ObservableSource.NONE, FxRateLookup.ofRates());

            coverImmutableBean(test);

            ImmutableMap <Currency, CurveId> discounts2 = ImmutableMap.of(GBP, CURVE_ID_DSC);
            ImmutableMap <Index, CurveId>    forwards2  = ImmutableMap.of(GBP_LIBOR_3M, CURVE_ID_FWD);
            DefaultRatesMarketDataLookup     test2      = DefaultRatesMarketDataLookup.of(discounts2, forwards2, OBS_SOURCE, FxRateLookup.ofRates(EUR));

            coverBeanEquals(test, test2);

            // related coverage
            coverImmutableBean((ImmutableBean)test.marketDataView(MOCK_CALC_MARKET_DATA));
            DefaultRatesScenarioMarketData.meta();

            coverImmutableBean((ImmutableBean)test.marketDataView(MOCK_MARKET_DATA));
            DefaultRatesMarketData.meta();

            coverImmutableBean((ImmutableBean)test.marketDataView(MOCK_MARKET_DATA).ratesProvider());
            DefaultLookupRatesProvider.meta();
        }
        private readonly FxRateProvider fxRateProvider;   // derived

        //-------------------------------------------------------------------------
        /// <summary>
        /// Obtains an instance based on a lookup and market data.
        /// <para>
        /// The lookup provides the mapping from currency to discount curve, and from
        /// index to forward curve. The curves are in the market data.
        ///
        /// </para>
        /// </summary>
        /// <param name="lookup">  the lookup </param>
        /// <param name="marketData">  the market data </param>
        /// <returns> the rates provider </returns>
        public static DefaultLookupRatesProvider of(DefaultRatesMarketDataLookup lookup, MarketData marketData)
        {
            return(new DefaultLookupRatesProvider(lookup, marketData));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ImmutableConstructor private DefaultLookupRatesProvider(DefaultRatesMarketDataLookup lookup, com.opengamma.strata.data.MarketData marketData)
        private DefaultLookupRatesProvider(DefaultRatesMarketDataLookup lookup, MarketData marketData)
        {
            this.lookup         = ArgChecker.notNull(lookup, "lookup");
            this.marketData     = ArgChecker.notNull(marketData, "marketData");
            this.fxRateProvider = lookup.fxRateProvider(marketData);
        }