Discount.class, LogLinear.class, IterativeBootstrap.class,
vars.settlementDays,
vars.calendar,
vars.instruments,
new Actual360());
final Flag f = new Flag();
vars.termStructure.addObserver(f);
for (int i=0; i<vars.deposits+vars.swaps; i++) {
/*@Time*/ final double testTime = new Actual360().yearFraction(vars.settlement, vars.instruments[i].latestDate());
/*@DiscountFactor*/ final double discount = vars.termStructure.discount(testTime);
f.lower();
vars.rates[i].setValue(vars.rates[i].value()*1.01);
if (!f.isUp())
throw new RuntimeException("Observer was not notified of underlying rate change");
if (vars.termStructure.discount(testTime,true) == discount)
throw new RuntimeException("rate change did not trigger recalculation");
vars.rates[i].setValue(vars.rates[i].value()/1.01);
}
f.lower();
new Settings().setEvaluationDate(vars.calendar.advance(vars.today, 15, TimeUnit.Days));
if (!f.isUp())
throw new RuntimeException("Observer was not notified of date change");
}