final ZonedDateTime payDate = ScheduleCalculator.getAdjustedDate(REFERENCE_DATE, Period.ofMonths(9), BUSINESS_DAY, CALENDAR);
final ZonedDateTime expDate = ScheduleCalculator.getAdjustedDate(payDate, -SETTLEMENT_DAYS, CALENDAR);
final double timeToExpiry = TimeCalculator.getTimeBetween(REFERENCE_DATE, expDate);
final ForexDefinition forexUnderlyingDefinition = new ForexDefinition(EUR, USD, payDate, notional, strike);
final ForexOptionDigitalDefinition forexOptionDefinition = new ForexOptionDigitalDefinition(forexUnderlyingDefinition, expDate, isCall, isLong, payDomestic);
final ForexOptionDigital forexOption = forexOptionDefinition.toDerivative(REFERENCE_DATE);
final double dfDomestic = MULTICURVES.getDiscountFactor(EUR, forexOption.getUnderlyingForex().getPaymentTime());
final double dfForeign = MULTICURVES.getDiscountFactor(USD, forexOption.getUnderlyingForex().getPaymentTime());
final double forward = 1 / SPOT * dfForeign / dfDomestic;
final double volatility = SMILE_TERM.getVolatility(new Triple<>(timeToExpiry, strike, 1 / forward));
final double sigmaRootT = volatility * Math.sqrt(forexOption.getExpirationTime());
final double dM = Math.log(forward * strike) / sigmaRootT - 0.5 * sigmaRootT;
final double omega = isCall ? -1.0 : 1.0;
final double pvExpected = Math.abs(forexOption.getUnderlyingForex().getPaymentCurrency1().getAmount()) * dfDomestic * NORMAL.getCDF(omega * dM)
* (isLong ? 1.0 : -1.0);
final MultipleCurrencyAmount pvComputed = METHOD_BLACK_DIGITAL.presentValue(forexOption, SMILE_MULTICURVES);
assertEquals("Forex Digital option: present value", pvExpected, pvComputed.getAmount(EUR), TOLERANCE_PV);
}