### Question:
Year extends RegularTimePeriod implements Serializable { @Override public RegularTimePeriod next() { if (this.year < Year.MAXIMUM_YEAR) { return new Year(this.year + 1); } else { return null; } } Year();  Year(int year);  Year(Date time);  Year(Date time, TimeZone zone, Locale locale); int getYear(); @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 Year parseYear(String s); static final int MINIMUM_YEAR; static final int MAXIMUM_YEAR; }### Answer:
@Test public void test9999Next() { Year current = new Year(9999); Year next = (Year) current.next(); assertNull(next); }
@Test public void testNext() { Year y = new Year(2000); y = (Year) y.next(); assertEquals(2001, y.getYear()); y = new Year(9999); assertNull(y.next()); }