@Test
public void testFormatMillis() {

    String format = "yyyyMMddHHmmss";
    SimpleDateFormat sdf = new SimpleDateFormat(format);
    sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
    DateCache dc = new DateCache(format, 1000);
    int now = (int) (System.currentTimeMillis() / 1000);
    for (int i = 0; i < 10000; i++) {
        int now2 = now + i;
        String str2 = sdf.format(new Date(now2 * 1000L));
        String str = dc.formatFor(now2);
        assertEquals("i: " + i, str2, str);
    }
}