### Question:
Time implements Comparable<Time> { @Override public int compareTo(Time t) { if ((secs > t.secs) || ((secs == t.secs) && nsecs > t.nsecs)) { return 1; } if ((secs == t.secs) && (nsecs == t.nsecs)) { return 0; } return -1; } Time();  Time(int secs, int nsecs);  Time(double secs);  Time(Time t); Time add(Duration d); Time subtract(Duration d); Duration subtract(Time t); static Time fromMillis(long timeInMillis); static Time fromNano(long timeInNs); @Override String toString(); double toSeconds(); long totalNsecs(); boolean isZero(); void normalize(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Time t); public int secs; public int nsecs; }### Answer:
@Test public void testComparable() { assertEquals(0, new Time(0, 0).compareTo(new Time(0, 0))); assertEquals(0, new Time(1, 1).compareTo(new Time(1, 1))); assertTrue(new Time(0, 1).compareTo(new Time(0, 0)) > 0); assertEquals(-1, new Time(0, 0).compareTo(new Time(0, 1))); assertTrue(new Time(0, 0).compareTo(new Time(0, 1)) < 0); assertTrue(new Time(1, 0).compareTo(new Time(0, 0)) > 0); assertTrue(new Time(0, 0).compareTo(new Time(1, 0)) < 0); }