assertTrue(TimeUtils.isYesterday(offset(TimeUtils.ONEDAY), null));
}
@Test
public void testDurations() throws Exception {
TimeUtils timeUtils = new TimeUtils();
assertEquals("1 day", timeUtils.duration(1));
assertEquals("5 days", timeUtils.duration(5));
assertEquals("3 months", timeUtils.duration(75));
assertEquals("12 months", timeUtils.duration(364));
assertEquals("1 year", timeUtils.duration(365 + 0));
assertEquals("1 year", timeUtils.duration(365 + 10));
assertEquals("1 year, 1 month", timeUtils.duration(365 + 15));
assertEquals("1 year, 1 month", timeUtils.duration(365 + 30));
assertEquals("1 year, 1 month", timeUtils.duration(365 + 44));
assertEquals("1 year, 2 months", timeUtils.duration(365 + 45));
assertEquals("1 year, 2 months", timeUtils.duration(365 + 60));
assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
}