### Question:
Day extends RegularTimePeriod implements Serializable { @Override public RegularTimePeriod next() { int serial = this.serialDate.toSerial(); if (serial < SerialDate.SERIAL_UPPER_BOUND) { SerialDate tomorrow = SerialDate.createInstance(serial + 1); return new Day(tomorrow); } return null; } Day();  Day(int day, int month, int year);  Day(SerialDate serialDate);  Day(Date time);  Day(Date time, TimeZone zone, Locale locale); SerialDate getSerialDate(); int getYear(); int getMonth(); int getDayOfMonth(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); @Override String toString(); static Day parseDay(String s);  }### Answer:
@Test public void test31Dec9999Next() { Day dec31st9999 = new Day(31, MonthConstants.DECEMBER, 9999); Day next = (Day) dec31st9999.next(); assertNull(next); }
@Test public void testNext() { Day d = new Day(25, 12, 2000); d = (Day) d.next(); assertEquals(2000, d.getYear()); assertEquals(12, d.getMonth()); assertEquals(26, d.getDayOfMonth()); d = new Day(31, 12, 9999); assertNull(d.next()); }