### Question:
Quarter extends RegularTimePeriod implements Serializable { @Override public RegularTimePeriod next() { Quarter result; if (this.quarter < LAST_QUARTER) { result = new Quarter(this.quarter + 1, this.year); } else { if (this.year < 9999) { result = new Quarter(FIRST_QUARTER, this.year + 1); } else { result = null; } } return result; } Quarter();  Quarter(int quarter, int year);  Quarter(int quarter, Year year);  Quarter(Date time);  Quarter(Date time, TimeZone zone, Locale locale); int getQuarter(); Year getYear(); int getYearValue(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); @Override String toString(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); static Quarter parseQuarter(String s); static final int FIRST_QUARTER; static final int LAST_QUARTER; static final int[] FIRST_MONTH_IN_QUARTER; static final int[] LAST_MONTH_IN_QUARTER; }### Answer:
@Test public void testQ1Y1900Next() { Quarter next = (Quarter) this.q1Y1900.next(); assertEquals(this.q2Y1900, next); }
@Test public void testQ4Y9999Next() { Quarter next = (Quarter) this.q4Y9999.next(); assertNull(next); }
@Test public void testNext() { Quarter q = new Quarter(1, 2000); q = (Quarter) q.next(); assertEquals(new Year(2000), q.getYear()); assertEquals(2, q.getQuarter()); q = new Quarter(4, 9999); assertNull(q.next()); }