// ----------------------------------------------------------------------- public void test_setInstant() { for (int i = -1100; i < 1100; i++) { Instant instant = Instant.ofEpochMilli(i); GregorianCalendar test = new GregorianCalendar(); test.setInstant(instant); assertEquals(test.getTimeInMillis(), i); } }
// ----------------------------------------------------------------------- public void test_toInstant() { for (int i = -1100; i < 1100; i++) { GregorianCalendar gcal = new GregorianCalendar(); gcal.setTimeInMillis(i); Instant test = gcal.toInstant(); assertEquals(test, Instant.ofEpochMilli(i)); } }