### Question:
SimpleTimePeriod implements TimePeriod, Comparable<TimePeriod>, Serializable { @Override public int hashCode() { int result = 17; result = 37 * result + (int) this.start; result = 37 * result + (int) this.end; return result; } SimpleTimePeriod(long start, long end);  SimpleTimePeriod(Date start, Date end); @Override Date getStart(); long getStartMillis(); @Override Date getEnd(); long getEndMillis(); @Override boolean equals(Object obj); @Override int compareTo(TimePeriod that); @Override int hashCode();  }### Answer:
@Test public void testHashcode() { SimpleTimePeriod s1 = new SimpleTimePeriod(new Date(10L), new Date(20L)); SimpleTimePeriod s2 = new SimpleTimePeriod(new Date(10L), new Date(20L)); assertEquals(s1, s2); int h1 = s1.hashCode(); int h2 = s2.hashCode(); assertEquals(h1, h2); }