public void testCalculatePreciseDuration()
{
PrettyTime prettyTime = new PrettyTime();
prettyTime.clearUnits();
Minute minutes = new Minute();
prettyTime.registerUnit(minutes, new ResourcesTimeFormat(minutes));
assertEquals("40 minutes ago",
prettyTime.format(prettyTime.calculatePreciseDuration(new Date(new Date().getTime() - 40*60*1000 - 40*1000))));
}