BogusTime local = new BogusTime();
local.value = advice.value = System.currentTimeMillis();
// Ten seconds into the future
advice.value += 10000;
BaseRelativeTime brt = new BaseRelativeTime(local);
assertEquals(brt.currentTime(), local.value);
brt.updateTime(advice.value);
long once = brt.currentTime();
assertTrue(once < advice.value);
assertTrue(once > local.value);
for (int i = 0; i < 100; i++) {
brt.updateTime(advice.value);
}
long many = brt.currentTime();
assertTrue(many > once);
assertTrue("after much advice, relative time is still closer to local time", (advice.value - many) < (once - local.value));
}