### Question:
IntegerTime implements Time { @Override public boolean greaterThan(Time t) { if (t != null) return this.time > ((IntegerTime) t).time; else return false; } IntegerTime();  IntegerTime(int time); @Override boolean equals(Time t); @Override int hashCode(); @Override boolean equals(Object obj); @Override void increment(); @Override void setTime(Time t); @Override String toString(); @Override Time clone(); @Override boolean greaterThan(Time t); @Override int intValue();  }### Answer:
@Test public void testGreaterThan() { final int lower = rand.nextInt(Integer.MAX_VALUE - 1); final int higher = rand.nextInt(Integer.MAX_VALUE - lower) + lower; assertTrue("Did not generate valid values", lower < higher); Time t1 = new IntegerTime(lower); Time t2 = new IntegerTime(lower); Time t3 = new IntegerTime(higher); assertTrue("IntegerTime(Y>X).greaterThan(X) should be true", t3.greaterThan(t1)); assertFalse("IntegerTime(Y<X).greaterThan(X) should be false", t1.greaterThan(t3)); assertFalse("IntegerTime(Y==X).greaterThan(X) should be false", t1.greaterThan(t2)); assertFalse("A.greaterThan(A) should be false", t1.greaterThan(t1)); assertFalse("A.greaterThan(null) should be false", t1.greaterThan(null)); }