@Test
public void test() {
final StandardOptionDataBundle data = new StandardOptionDataBundle(R, B, new VolatilitySurface(ConstantDoublesSurface.from(0.25)), SPOT, DATE);
Barrier barrier = new Barrier(KnockType.OUT, BarrierType.DOWN, ObservationType.CONTINUOUS, 95);
EuropeanStandardBarrierOptionDefinition option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, true, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 9.0246, EPS);
barrier = new Barrier(KnockType.OUT, BarrierType.UP, ObservationType.CONTINUOUS, 105);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, true, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 2.6789, EPS);
barrier = new Barrier(KnockType.OUT, BarrierType.DOWN, ObservationType.CONTINUOUS, 95);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, false, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 2.2798, EPS);
barrier = new Barrier(KnockType.OUT, BarrierType.UP, ObservationType.CONTINUOUS, 105);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, false, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 3.7760, EPS);
barrier = new Barrier(KnockType.IN, BarrierType.DOWN, ObservationType.CONTINUOUS, 95);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, true, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 7.7627, EPS);
barrier = new Barrier(KnockType.IN, BarrierType.UP, ObservationType.CONTINUOUS, 105);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, true, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 14.1112, EPS);
barrier = new Barrier(KnockType.IN, BarrierType.DOWN, ObservationType.CONTINUOUS, 95);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, false, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 2.9586, EPS);
barrier = new Barrier(KnockType.IN, BarrierType.UP, ObservationType.CONTINUOUS, 105);
option = new EuropeanStandardBarrierOptionDefinition(90, EXPIRY, false, barrier, REBATE);
assertEquals(MODEL.getPricingFunction(option).evaluate(data), 1.4653, EPS);
}