DateTimeMonth extends DateTimePeriod { @Override public DateTimePeriod getNext() { DateTime next = getStart().plusMonths(1); return DateTimePeriod.createMonth(next); } protected  DateTimeMonth(DateTime start, DateTime end); @Override DateTimePeriod getNext(); @Override DateTimePeriod getPrevious(); @Override DateTimeDuration getDefaultSubDuration();  }
@Test public void getNext() throws Exception { DateTimePeriod period0 = DateTimePeriod.createMonth(2009, 12, DateTimeZone.UTC); DateTimePeriod period1 = period0.getNext(); DateTime correctStart = new DateTime(2010,1,1,0,0,0,0,DateTimeZone.UTC); DateTime correctEnd = new DateTime(2010,2,1,0,0,0,0,DateTimeZone.UTC); Assert.assertEquals(correctStart, period1.getStart()); Assert.assertEquals(correctEnd, period1.getEnd()); }