### Question:
DefaultRatesMarketDataLookup implements RatesMarketDataLookup, ImmutableBean, Serializable { public static DefaultRatesMarketDataLookup of( Map<Currency, CurveId> discountCurveIds, Map<? extends Index, CurveId> forwardCurveIds, ObservableSource obsSource, FxRateLookup fxLookup) { return new DefaultRatesMarketDataLookup(discountCurveIds, forwardCurveIds, obsSource, fxLookup); } private  DefaultRatesMarketDataLookup(
      Map<Currency, CurveId> discountCurves,
      Map<? extends Index, CurveId> forwardCurves,
      ObservableSource observableSource,
      FxRateLookup fxRateLookup); static DefaultRatesMarketDataLookup of(
      Map<Currency, CurveId> discountCurveIds,
      Map<? extends Index, CurveId> forwardCurveIds,
      ObservableSource obsSource,
      FxRateLookup fxLookup); @Override ImmutableSet<Currency> getDiscountCurrencies(); @Override ImmutableSet<MarketDataId<?>> getDiscountMarketDataIds(Currency currency); @Override ImmutableSet<Index> getForwardIndices(); @Override ImmutableSet<MarketDataId<?>> getForwardMarketDataIds(Index index); @Override FunctionRequirements requirements(Set<Currency> currencies, Set<? extends Index> indices); @Override RatesProvider ratesProvider(MarketData marketData); @Override FxRateProvider fxRateProvider(MarketData marketData); static TypedMetaBean<DefaultRatesMarketDataLookup> meta(); @Override TypedMetaBean<DefaultRatesMarketDataLookup> metaBean(); ImmutableMap<Currency, CurveId> getDiscountCurves(); ImmutableMap<Index, CurveId> getForwardCurves(); @Override ObservableSource getObservableSource(); @Override FxRateLookup getFxRateLookup(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void validateObservableSourceDiscountCurves() { ObservableSource observableSource = ObservableSource.of("source"); CurveId curveId = CurveId.of(CurveGroupName.of("group"), CurveName.of("curves"), observableSource); Map<Currency, CurveId> curveMap = ImmutableMap.of(Currency.USD, curveId); DefaultRatesMarketDataLookup.of(curveMap, ImmutableMap.of(), observableSource, FxRateLookup.ofRates()); assertThatIllegalArgumentException() .isThrownBy( () -> DefaultRatesMarketDataLookup.of(curveMap, ImmutableMap.of(), ObservableSource.NONE, FxRateLookup.ofRates())) .withMessageContaining("must match the observable source in all curve IDs"); }
@Test public void validateObservableSourceForwardCurves() { ObservableSource observableSource = ObservableSource.of("source"); CurveId curveId = CurveId.of(CurveGroupName.of("group"), CurveName.of("curves"), observableSource); Map<IborIndex, CurveId> curveMap = ImmutableMap.of(IborIndices.AUD_BBSW_1M, curveId); DefaultRatesMarketDataLookup.of(ImmutableMap.of(), curveMap, observableSource, FxRateLookup.ofRates()); assertThatIllegalArgumentException() .isThrownBy( () -> DefaultRatesMarketDataLookup.of(ImmutableMap.of(), curveMap, ObservableSource.NONE, FxRateLookup.ofRates())) .withMessageContaining("must match the observable source in all curve IDs"); }