test_class.file: ch-commons-util/src/test/java/com/cloudhopper/commons/util/time/DateTimePeriodSelectorTest.java
test_class.identifier: DateTimePeriodSelectorTest
test_case.body: @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());
      }
test_case.class_method_signature: DateTimePeriodSelectorTest.last12Months()
test_case.full_signature: @Test public void last12Months()
test_case.identifier: last12Months
test_case.invocations: last12Months minusMonths createMonth getYear getMonthOfYear add getNext add getNext add getNext add getNext add getNext add getNext add getNext add getNext add getNext add getNext add getNext add assertArrayEquals toArray toArray
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void last12Months()
focal_class.file: ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriodSelector.java
focal_class.identifier: DateTimePeriodSelector
focal_class.class_method_signature: DateTimePeriodSelector.DateTimePeriodSelector()
focal_class.full_signature: private  DateTimePeriodSelector()
focal_class.identifier: DateTimePeriodSelector
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  DateTimePeriodSelector()
focal_class.class_method_signature: DateTimePeriodSelector.thisMonth(DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod thisMonth(DateTimeZone zone)
focal_class.identifier: thisMonth
focal_class.modifiers: static public
focal_class.parameters: (DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod thisMonth(DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriodSelector.lastMonth(DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod lastMonth(DateTimeZone zone)
focal_class.identifier: lastMonth
focal_class.modifiers: static public
focal_class.parameters: (DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod lastMonth(DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriodSelector.last12Months(DateTimeZone zone)
focal_class.full_signature: static public List<DateTimePeriod> last12Months(DateTimeZone zone)
focal_class.identifier: last12Months
focal_class.modifiers: static public
focal_class.parameters: (DateTimeZone zone)
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> last12Months(DateTimeZone zone)
focal_method.body: static public List<DateTimePeriod> last12Months(DateTimeZone zone) {
          ArrayList<DateTimePeriod> periods = new ArrayList<DateTimePeriod>();
  
          // get today's date
          DateTime now = new DateTime(zone);
  
          // start with today's current month and 11 others (last 12 months)
          for (int i = 0; i < 12; i++) {
              // create a new period
              DateTimePeriod period = DateTimePeriod.createMonth(now.getYear(), now.getMonthOfYear(), zone);
              periods.add(period);
              // subtract 1 month
              now = now.minusMonths(1);
          }
  
          Collections.reverse(periods);
  
          return periods;
      }
focal_method.class_method_signature: DateTimePeriodSelector.last12Months(DateTimeZone zone)
focal_method.full_signature: static public List<DateTimePeriod> last12Months(DateTimeZone zone)
focal_method.identifier: last12Months
focal_method.invocations: createMonth getYear getMonthOfYear add minusMonths reverse
focal_method.modifiers: static public
focal_method.parameters: (DateTimeZone zone)
focal_method.return: List<DateTimePeriod>
focal_method.signature: List<DateTimePeriod> last12Months(DateTimeZone zone)