@Test
public void last12Months() throws Exception {

    List<DateTimePeriod> periods = DateTimePeriodSelector.last12Months(DateTimeZone.UTC);
    DateTime now = new DateTime(DateTimeZone.UTC);
    
    // create our list for comparison
    DateTime startingMonth = now.minusMonths(12);
    DateTimePeriod startingPeriod = DateTimePeriod.createMonth(startingMonth.getYear(), startingMonth.getMonthOfYear(), DateTimeZone.UTC);
    ArrayList<DateTimePeriod> expectedPeriods = new ArrayList<DateTimePeriod>();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    startingPeriod = startingPeriod.getNext();
    expectedPeriods.add(startingPeriod);
    Assert.assertArrayEquals(expectedPeriods.toArray(), periods.toArray());
}