MarketDataShock implements ScenarioArgument<MarketDataShock, MarketDataShockDecorator> { public static MarketDataShock replace(double value, MarketDataMatcher matcher) { return new Replace(value, matcher); } protected  MarketDataShock(MarketDataMatcher matcher); @Override Class<MarketDataShockDecorator> getFunctionType(); final double apply(ExternalIdBundle id, double value); static MarketDataShock absoluteShift(double shiftAmount, MarketDataMatcher matcher); static MarketDataShock relativeShift(double shiftAmount, MarketDataMatcher matcher); static MarketDataShock replace(double value, MarketDataMatcher matcher);  }
@Test public void replace() { MarketDataShock shock = MarketDataShock.replace(7d, MATCHER); assertEquals(7d, shock.apply(MATCHING_ID, 1d)); assertEquals(1d, shock.apply(NON_MATCHING_ID, 1d)); }