public void test() {
final YieldCurve shortRate = YieldCurve.from(ConstantDoublesCurve.from(0.05));
final double longRate = 0.06;
final double speed = 0.01;
final VolatilityCurve sigma = new VolatilityCurve(ConstantDoublesCurve.from(0.01));
VasicekDataBundle data = new VasicekDataBundle(shortRate, sigma, TODAY, longRate, speed);
assertEquals(MODEL.getDiscountBondFunction(START, START).evaluate(data), 1, 0);
data = new VasicekDataBundle(shortRate, new VolatilityCurve(ConstantDoublesCurve.from(0)), TODAY, longRate, speed);
final double factor = (1 - Math.exp(-speed * YEARS));
final double lnA = longRate * (factor / speed - YEARS);
assertEquals(MODEL.getDiscountBondFunction(START, MATURITY).evaluate(data), Math.exp(lnA - data.getShortRate(0) * factor / speed), 0);
}