### Question:
Time extends TimeBase<Time> { public Date toDate() { Calendar c = Calendar.getInstance(); c.setTimeInMillis((long) (this.toSec() * (double) TimeBase.SECS_TO_MILLI)); return c.getTime(); } Time();  Time(int secs, int nsecs);  Time(double sec);  Time(long nano); @Override Time add(Time t); @Override Time subtract(Time t); boolean isValid(); Date toDate(); static boolean sleepUntil(Time t); @Override Time clone(); static Time now(); static Time fromSec(double sec); static Time fromNano(long nano); static Time fromDate(Date date); static Time fromJsonString(String jsonString); static Time fromJsonObject(JsonObject jsonObject); static final String TYPE; }### Answer:
@Test public void testToDate() { Date emptyDate = empty.toDate(); Date date1 = t1.toDate(); Date date2 = t2.toDate(); Date date3 = t3.toDate(); assertEquals(0l, emptyDate.getTime()); assertEquals(10200l, date1.getTime()); assertEquals(0l, date2.getTime()); assertEquals(10000l, date3.getTime()); }