@@ -0,0 +1,1049 @@
+package com.insightfullogic.java8.test.chapter4;%0D%0A%0D%0Aimport static org.junit.Assert.*;%0D%0A%0D%0Aimport java.util.Optional;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport com.insightfullogic.java8.answers.chapter4.ArtistsFixed;%0D%0Aimport com.insightfullogic.java8.examples.chapter1.Artist;%0D%0Aimport com.insightfullogic.java8.examples.chapter1.SampleData;%0D%0A%0D%0Apublic class ArtistsFixedTest %7B%0D%0A%0D%0A%09private final ArtistsFixed optionalExamples = new ArtistsFixed(SampleData.getThreeAtrists());%0D%0A%0D%0A%09@Test%0D%0A%09public void indexWithinRange() %7B%0D%0A%09%09Optional%3CArtist%3E artist = optionalExamples.getArtist(0);%0D%0A%09%09assertTrue(artist.isPresent());%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void indexOutsideRange() %7B%0D%0A%09%09Optional%3CArtist%3E artist = optionalExamples.getArtist(5);%0D%0A%09%09assertFalse(artist.isPresent());%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void getNameWithinRange() %7B%0D%0A%09%09String artist = optionalExamples.getArtistName(1);%0D%0A%09%09assertEquals(%22John Lennon%22, artist);%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void getNameOutsideRange() %7B%0D%0A%09%09String artist = optionalExamples.getArtistName(5);%0D%0A%09%09assertEquals(%22unknown%22, artist);%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add test for ArtistsFixed in chapter4