question: @ Override public List < Period > generatePeriods ( Date date ) { Calendar cal = createCalendarInstance ( date ) ; cal . add ( Calendar . YEAR , cal . get ( Calendar . YEAR ) % 2 == 0 ? - 10 : - 9 ) ; cal . set ( Calendar . DAY_OF_YEAR , 1 ) ; ArrayList < Period > twoYears = new ArrayList < > ( ) ; for ( int i = 0 ; i < 11 ; ++ i ) { Date startDate = cal . getTime ( ) ; cal . add ( Calendar . YEAR , 1 ) ; cal . set ( Calendar . DAY_OF_YEAR , cal . getActualMaximum ( Calendar . DAY_OF_YEAR ) ) ; twoYears . add ( new Period ( this , startDate , cal . getTime ( ) ) ) ; cal . add ( Calendar . DAY_OF_YEAR , 1 ) ; } return twoYears ; }
target:  Generates two-yearly Periods for the last 10, current and next 10 years.