### Question:
Day implements Comparable { @Override public int compareTo(Object o) { return this.dayStr.compareTo(((Day)o).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 compareTo() { String dayStr = "20180105", dayStr2 = "20180106", dayStr3 = "20180107"; Day day = new Day(dayStr), day2 = new Day(dayStr2), day3 = new Day(dayStr3); assertEquals(-2, day.compareTo(day3), 0); assertEquals(0, day.compareTo(new Day(dayStr)), 0); assertEquals(0, day.compareTo(day), 0); assertEquals(1, day2.compareTo(day), 0); }