### Question:
IntegerTime implements Time { @Override public boolean equals(Time t) { if(t == null) return false; return this.intValue() == t.intValue(); } 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 testEqualsTime() { final int defaultValue = 0; final int t3Value = rand.nextInt(); Time t1 = new IntegerTime(); assertFalse("IntegerTime(0).equals(null) should be false", t1.equals(null)); int t1Check; do { t1Check = rand.nextInt(); } while (t1Check == defaultValue); assertFalse("IntegerTime().equals(x != 0) should be false", t1.equals(t1Check)); assertTrue("A.equals(A) should be true", t1.equals(t1)); Time t2 = new IntegerTime(); assertTrue("IntegerTime().equals(IntegerTime()) should be true", t1.equals(t2)); Time t3 = new IntegerTime(t3Value); assertFalse( "IntegerTime().equals(IntegerTime(N != 0)) should be false", t2.equals(t3)); assertFalse( "IntegerTime(N != 0).equals(IntegerTime()) should be false", t3.equals(t2)); int t3Check; do { t3Check = rand.nextInt(); } while (t3Check == t3Value); assertFalse("IntegerTime(N).equals(X != N) should be false", t3.equals(t3Check)); assertFalse("IntegerTime(N).equals(Integer(X != N)) should be false", t3.equals(Integer.valueOf(t3Check))); assertTrue("IntegerTime.equals should work with Time cast to object", t1.equals((Object) t2)); assertFalse("IntegerTime.equals should work with Time cast to object", t2.equals((Object) t3)); assertFalse( "IntegerTime.equals(A) where A is not Time or Integer should return false", t1.equals("0")); }