@@ -0,0 +1,760 @@
+package com.yutax77.java8_ans.chap5;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport java.time.LocalDate;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class Ans2Test %7B%0A    private LocalDate date;%0A    %0A    @Before%0A    public void setUp() %7B%0A%09date = LocalDate.of(2000, 2, 29);%09%0A    %7D%0A    %0A    @Test%0A    public void testPlusOneYear() %7B%0A%09assertThat(date.plusYears(1), is(LocalDate.of(2001, 2, 28)));%0A    %7D%0A    %0A    @Test%0A    public void testPlusFourYear() %7B%0A%09assertThat(date.plusYears(4), is(LocalDate.of(2004, 2, 29)));%0A    %7D%0A    %0A    @Test%0A    public void testPlusOneByOneYear() %7B%0A%09for(int i = 0; i %3C 4; i++) %7B%0A%09    date = date.plusYears(1);%0A%09%7D%0A%09assertThat(date, is(LocalDate.of(2004, 2, 28)));%0A    %7D%0A%7D%0A

Answer chap.5-2