class HistoricalShockMarketDataSnapshot implements MarketDataSnapshot {

  @Override
  public Object query(ValueSpecification specification) {
    Object value1 = _historicalSnapshot1.query(specification);
    Object value2 = _historicalSnapshot2.query(specification);
    Object baseValue = _baseSnapshot.query(specification);
    if (!(value1 instanceof Double) || !(value2 instanceof Double) || !(baseValue instanceof Double)) {
      return baseValue;
    }
    return _shockType.shock((Double) value1, (Double) value2, (Double) baseValue);
  }

  public  HistoricalShockMarketDataSnapshot(ShockType shockType,
                                           MarketDataSnapshot historicalSnapshot1,
                                           MarketDataSnapshot historicalSnapshot2,
                                           MarketDataSnapshot baseSnapshot);

}