DateTimePeriodSelector { static public DateTimePeriod thisMonth(DateTimeZone zone) { DateTime now = new DateTime(zone); return DateTimePeriod.createMonth(now.getYear(), now.getMonthOfYear(), zone); } private  DateTimePeriodSelector(); static DateTimePeriod thisMonth(DateTimeZone zone); static DateTimePeriod lastMonth(DateTimeZone zone); static List<DateTimePeriod> last12Months(DateTimeZone zone);  }
@Test public void thisMonth() throws Exception { DateTimePeriod period = DateTimePeriodSelector.thisMonth(DateTimeZone.UTC); DateTime now = new DateTime(DateTimeZone.UTC); DateTimePeriod expectedPeriod = DateTimePeriod.createMonth(now.getYear(), now.getMonthOfYear(), DateTimeZone.UTC); Assert.assertEquals(expectedPeriod, period); }