### Question:
HoursPeriod { public boolean equals(Object p){ if(p instanceof HoursPeriod) return ((HoursPeriod)p).begining==begining&&((HoursPeriod)p).ending==ending; return false; } HoursPeriod(int begining,int ending); boolean inPeriod(Date date); String toString(); boolean equals(Object p);  }### Answer:
@Test public void equalsTest() throws ParseException{ HoursPeriod p1=new HoursPeriod(0, 1440); HoursPeriod p2=new HoursPeriod(0, 1440); HoursPeriod p3=new HoursPeriod(600, 1080); HoursPeriod p4=new HoursPeriod(0, 1080); assertFalse(p1.equals(p3)); assertFalse(p3.equals(p1)); assertFalse(p4.equals(p1)); assertFalse(p1.equals(p4)); assertTrue(p1.equals(p2)); assertFalse(p1.equals("string")); }