final double r = 0.08;
final double b = 0.04;
final double sigma = 0.3;
final EuropeanVanillaOption option = new EuropeanVanillaOption(strike, expiry, isCall);
final Barrier barrierIn = new Barrier(KnockType.IN, BarrierType.DOWN, ObservationType.CONTINUOUS, barrerLevel);
final double p1In = PRICER.getPrice(option, barrierIn, rebate, spot, b, r, sigma);
final double p2In = PRICER.inBarrier(spot, barrerLevel, strike, expiry, r, b, sigma, isCall, rebate);
assertEquals(p1In, p2In, 1e-20);
final Barrier barrierOut = new Barrier(KnockType.OUT, BarrierType.DOWN, ObservationType.CONTINUOUS, barrerLevel);
final double p1Out = PRICER.getPrice(option, barrierOut, rebate, spot, b, r, sigma);
final double p2Out = PRICER.outBarrier(spot, barrerLevel, strike, expiry, r, b, sigma, isCall, rebate);
assertEquals(p1Out, p2Out, 1e-20);
}