question: @ Override public List < Period > generateLast5Years ( Date date ) { Calendar calendar = getCalendar ( ) ; DateTimeUnit dateTimeUnit = createLocalDateUnitInstance ( date ) ; dateTimeUnit = calendar . minusYears ( dateTimeUnit , 4 ) ; dateTimeUnit . setDay ( 1 ) ; dateTimeUnit . setMonth ( 1 ) ; List < Period > periods = Lists . newArrayList ( ) ; for ( int i = 0 ; i < 5 ; ++ i ) { periods . add ( createPeriod ( dateTimeUnit , calendar ) ) ; dateTimeUnit = calendar . plusYears ( dateTimeUnit , 1 ) ; } return periods ; }
target:  Generates the last 5 years where the last one is the year which the given date is inside.