TwoAssetCorrelationOptionFunctionProvider extends OptionFunctionProvider2D { @Override public double getStrike() { throw new IllegalArgumentException("Specify strike for asset 1 or strike for asset 2"); } TwoAssetCorrelationOptionFunctionProvider(final double strike1, final double strike2, final double timeToExpiry, final int steps, final boolean isCall); @Override double[][] getPayoffAtExpiry(final double assetPrice1, final double assetPrice2, final double upOverDown1, final double upOverDown2); @Override double[][] getPayoffAtExpiryTrinomial(final double assetPrice1, final double assetPrice2, final double middleOverDown1, final double middleOverDown2); double getStrike1(); double getStrike2(); @Override double getStrike(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void getStrikeFailTest() { final TwoAssetCorrelationOptionFunctionProvider function = new TwoAssetCorrelationOptionFunctionProvider(100., 101., 1., 1001, true); function.getStrike(); }