import java.time.OffsetDateTime;
import java.time.ZoneOffset;

public class TestOffsetDateTime {

	public static void main(String[] args) {
		OffsetDateTime ods = OffsetDateTime.of(2001, 02, 28, 22, 0, 0, 0, ZoneOffset.ofHours(2)); 
        OffsetDateTime due0 = ods.plusYears(14); 
        System.out.println(due0); 
        //This yields the result of: '2015-02-28T22:00+02:00' as expected. 
        //This is basically the 28th of February or 1st of March depending on where the date is rendered 

        OffsetDateTime due1 = ods.plusYears(15); 
        System.out.println(due1); 
        //This yields the result of: '2016-02-28T22:00+02:00'. 
        //This is basically the 28th or 29th of February depending on where the date is rendered. 
        //However should this not be the 29th of February or 1st of March depending on where it's rendered? That would be the same end of month boundary. 

        OffsetDateTime ods1 = OffsetDateTime.of(2000, 02, 29, 22, 0, 0, 0, ZoneOffset.ofHours(2)); 
        due1 = ods1.plusYears(16); 
        System.out.println(due1); 
        //This yields the result of: '2016-02-29T22:00+02:00'. 
        //This is basically the 29th of February or 1st of March depending on where the date is rendered. 
        //This is as expected. Note that the start date is in a leap year - i.e. 29th February. 
	}

}
