### Question:
Millisecond extends RegularTimePeriod implements Serializable, 
        Comparable<TimePeriod> { @Override public RegularTimePeriod next() { RegularTimePeriod result = null; if (this.millisecond != LAST_MILLISECOND_IN_SECOND) { result = new Millisecond(this.millisecond + 1, getSecond()); } else { Second next = (Second) getSecond().next(); if (next != null) { result = new Millisecond(FIRST_MILLISECOND_IN_SECOND, next); } } return result; } Millisecond();  Millisecond(int millisecond, Second second);  Millisecond(int millisecond, int second, int minute, int hour,
                       int day, int month, int year);  Millisecond(Date time);  Millisecond(Date time, TimeZone zone, Locale locale); Second getSecond(); long getMillisecond(); @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 obj); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); static final int FIRST_MILLISECOND_IN_SECOND; static final int LAST_MILLISECOND_IN_SECOND; }### Answer:
@Test public void testNext() { Millisecond m = new Millisecond(555, 55, 30, 1, 12, 12, 2000); m = (Millisecond) m.next(); assertEquals(2000, m.getSecond().getMinute().getHour().getYear()); assertEquals(12, m.getSecond().getMinute().getHour().getMonth()); assertEquals(12, m.getSecond().getMinute().getHour().getDayOfMonth()); assertEquals(1, m.getSecond().getMinute().getHour().getHour()); assertEquals(30, m.getSecond().getMinute().getMinute()); assertEquals(55, m.getSecond().getSecond()); assertEquals(556, m.getMillisecond()); m = new Millisecond(999, 59, 59, 23, 31, 12, 9999); assertNull(m.next()); }