### Question:
IntervalDayTime { public static long toMillis(long day, long hour, long minute, long second, long millis) { try { long value = millis; value = addExact(value, multiplyExact(day, MILLIS_IN_DAY)); value = addExact(value, multiplyExact(hour, MILLIS_IN_HOUR)); value = addExact(value, multiplyExact(minute, MILLIS_IN_MINUTE)); value = addExact(value, multiplyExact(second, MILLIS_IN_SECOND)); return value; } catch (ArithmeticException e) { throw new IllegalArgumentException(e); } } private  IntervalDayTime(); static long toMillis(long day, long hour, long minute, long second, long millis); static String formatMillis(long millis); static long parseMillis(String value);  }### Answer:
@Test public void testFormat() { assertMillis(0, "0 00:00:00.000"); assertMillis(1, "0 00:00:00.001"); assertMillis(-1, "-0 00:00:00.001"); assertMillis(toMillis(12, 13, 45, 56, 789), "12 13:45:56.789"); assertMillis(toMillis(-12, -13, -45, -56, -789), "-12 13:45:56.789"); assertMillis(Long.MAX_VALUE, "106751991167 07:12:55.807"); assertMillis(Long.MIN_VALUE + 1, "-106751991167 07:12:55.807"); assertMillis(Long.MIN_VALUE, "-106751991167 07:12:55.808"); }
@Test public void textMaxDays() { long days = Long.MAX_VALUE / DAYS.toMillis(1); assertEquals(toMillis(days, 0, 0, 0, 0), DAYS.toMillis(days)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testOverflow() { long days = (Long.MAX_VALUE / DAYS.toMillis(1)) + 1; toMillis(days, 0, 0, 0, 0); }