/**
 * Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.strata.engine.calculations;

import com.opengamma.strata.engine.marketdata.mapping.MarketDataMappings;
import com.opengamma.strata.marketdata.id.MarketDataVendor;
import com.opengamma.strata.marketdata.id.ObservableId;
import com.opengamma.strata.marketdata.key.MarketDataKey;
import com.opengamma.strata.marketdata.key.ObservableKey;

/**
 * Market data mappings used when the market data rules don't match a calculation target.
 * <p>
 * This means there are no mappings available to choose the market data for the calculations.
 * If market data is requested, this mapping returns an ID which results in a failure in the
 * market data with an error message explaining the problem.
 * <p>
 * This class uses raw types because there is no other way for it do implement its interface.
 */
class NoMatchingRuleMappings implements MarketDataMappings {

  /** Singleton instance. */
  static final NoMatchingRuleMappings INSTANCE = new NoMatchingRuleMappings();

  // This class has no state so there is no need to create multiple instances
  private NoMatchingRuleMappings() {
  }

  @SuppressWarnings("unchecked")
  @Override
  public NoMatchingRuleId getIdForKey(MarketDataKey key) {
    return NoMatchingRuleId.builder().key(key).build();
  }

  /**
   * Returns an ID with the market data vendor {@link MarketDataVendor#NO_RULE}.
   *
   * @param key  a market data key identifying an item of observable market data
   * @return an ID with the market data vendor {@code NO_RULE_VENDOR}.
   */
  @Override
  public ObservableId getIdForObservableKey(ObservableKey key) {
    return key.toObservableId(MarketDataVendor.NO_RULE);
  }
}

@@ -256,16 +256,72 @@
 ppings;%0A
+import com.opengamma.strata.marketdata.id.MarketDataId;%0A
 import c
@@ -1344,30 +1344,26 @@
  public 
-NoMatchingRule
+MarketData
 Id getId
@@ -1398,57 +1398,141 @@
     
-return NoMatchingRuleId.builder().key(key).build(
+if (key instanceof ObservableKey) %7B%0A      return getIdForObservableKey((ObservableKey) key);%0A    %7D%0A    return NoMatchingRuleId.of(key
 );%0A 

Fix #76 - Fix test