### Question:
Day implements Comparable { @Override public boolean equals(Object dayObject) { if (dayObject == null || dayObject.getClass() != this.getClass()){ return false; } Day day = (Day) dayObject; return this.dayStr.equals(day.dayStr); } Day(String dayStr);  Day(String dayStr, List<Integer> hours); String getDayStr(); List<Integer> getHours(); static List<Day> buildSortedDays(List<Range> ranges); static Set<String> getDayString(Set<Day> days); static Set<String> getDayStringTreated(Set<Day> days, String toBeRemoved); @Override int hashCode(); @Override boolean equals(Object dayObject); static String treatDayStr(String dayStr); @Override int compareTo(Object o);  }### Answer:
@Test public void testEquals() { String dayStr = "20180105", dayStr2 = "20180106", dayStr3 = "20180107"; Day day = new Day(dayStr), day2 = new Day(dayStr2), day3 = new Day(dayStr3); assertFalse(day.equals(null)); assertFalse(day.equals(day3)); assertTrue(day.equals(new Day(dayStr))); assertTrue(day.equals(day)); assertFalse(day2.equals(day3)); }