SupershareOptionFunctionProvider extends OptionFunctionProvider1D { @Override public double getSign() { throw new IllegalArgumentException("Call/put is not relevant for this option"); } SupershareOptionFunctionProvider(final double timeToExpiry, final double lowerBound, final double upperBound, final int steps); @Override double[] getPayoffAtExpiry(final double assetPrice, final double downFactor, final double upOverDown); @Override double[] getPayoffAtExpiryTrinomial(final double assetPrice, final double downFactor, final double middleOverDown); double getLowerBound(); double getUpperBound(); @Override double getSign(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void getSignErrorTest() { final double ref = 100.; final double lowerBound = ref * 0.9; final double upperBound = ref * 1.1; final int steps = 801; final OptionFunctionProvider1D function = new SupershareOptionFunctionProvider(TIME, lowerBound, upperBound, steps); function.getSign(); }