BlackFormula { public final double computePrice() { Validate.notNull(_lognormalVol, "Black Volatility parameter, _vol, has not been set."); return BlackFormulaRepository.price(_forward, _strike, _expiry, _lognormalVol, _isCall); } @Deprecated  BlackFormula(final double forward, final double strike, final double expiry, final Double lognormalVol, final Double fwdPrice, final boolean isCall); final double computePrice(); final double computeForwardDelta(); final Double computeStrikeImpliedByForwardDelta(final double fwdDelta, final boolean forCall); final double computeStrikeSensitivity(); final double computeImpliedVolatility(); final Double computeStrikeImpliedByDeltaViaRootFinding(final double fwdDelta, final boolean forCall); final double getForward(); final void setForward(final double forward); final double getStrike(); final void setStrike(final double strike); final double getExpiry(); final void setExpiry(final double expiry); final Double getLognormalVol(); final void setLognormalVol(final Double vol); final Double getFwdMtm(); final void setMtm(final Double fwdMtm); final void setIsCall(final boolean bCall); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testAtmPrices() { final BlackFormula call = new BlackFormula(FORWARD, FORWARD, T, SIGMA, null, true); final BlackFormula put = new BlackFormula(FORWARD, FORWARD, T, SIGMA, null, false); assertEquals(call.computePrice(), put.computePrice(), EPS); }