MarketDataShock implements ScenarioArgument<MarketDataShock, MarketDataShockDecorator> { public static MarketDataShock absoluteShift(double shiftAmount, MarketDataMatcher matcher) { return new AbsoluteShift(shiftAmount, 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 absoluteShift() { MarketDataShock shockUp = MarketDataShock.absoluteShift(2d, MATCHER); assertEquals(5d, shockUp.apply(MATCHING_ID, 3d), DELTA); assertEquals(3d, shockUp.apply(NON_MATCHING_ID, 3d), DELTA); MarketDataShock shockDown = MarketDataShock.absoluteShift(-2d, MATCHER); assertEquals(1d, shockDown.apply(MATCHING_ID, 3d), DELTA); }