@Override public List<Period> generatePeriods(DateTimeUnit dateTimeUnit){
  Calendar cal=getCalendar();
  Period period=createPeriod(dateTimeUnit,cal);
  dateTimeUnit=createLocalDateUnitInstance(period.getStartDate(),cal);
  List<Period> periods=Lists.newArrayList();
  if (dateTimeUnit.getMonth() == getBaseMonth()) {
    periods.add(period);
    periods.add(getNextPeriod(period));
  }
 else {
    periods.add(getPreviousPeriod(period));
    periods.add(period);
  }
  return periods;
}

@ Override public List < Period > generatePeriods ( DateTimeUnit dateTimeUnit ) { Calendar cal = getCalendar ( ) ; Period period = createPeriod ( dateTimeUnit , cal ) ; dateTimeUnit = createLocalDateUnitInstance ( period . getStartDate ( ) , cal ) ; List < Period > periods = Lists . newArrayList ( ) ; if ( dateTimeUnit . getMonth ( ) == getBaseMonth ( ) ) { periods . add ( period ) ; periods . add ( getNextPeriod ( period ) ) ; } else { periods . add ( getPreviousPeriod ( period ) ) ; periods . add ( period ) ; } return periods ; }
generates six - monthly periods for the whole year in which the given period ' s startdate exists .
