package com.insightfullogic.java8.examples.chapter1;

import java.util.List;
import java.util.Objects;

public final class Album implements Performance {
	
	private String name;
	private List<Track> tracks;
	private List<Artist> musicians;

	public Album(String name, List<Track> tracks, List<Artist> musicians) {
		Objects.requireNonNull(name);
		Objects.requireNonNull(tracks);
		Objects.requireNonNull(musicians);

		this.name = name;
		this.tracks = tracks;
		this.musicians = musicians;
	}
	
	
}

@@ -99,16 +99,194 @@
 bjects;%0D
+%0Aimport java.util.stream.Collectors;%0D%0Aimport java.util.stream.Stream;%0D%0A%0D%0Aimport static java.util.Collections.unmodifiableList;%0D%0Aimport static java.util.stream.Collectors.toList;%0D
 %0A%0D%0Apubli
@@ -690,13 +690,679 @@
 %09%7D%0D%0A%09%0D%0A%09
+public String getName()%7B%0D%0A%09%09return name;%0D%0A%09%7D%0D%0A%09%0D%0A%09public Stream%3CTrack%3E getTracks() %7B%0D%0A%09%09return tracks.stream();%0D%0A%09%7D%0D%0A%09%0D%0A%09public List%3CTrack%3E getTrackList()%7B%0D%0A%09%09return unmodifiableList(tracks);%0D%0A%09%7D%0D%0A%09%0D%0A%09public Stream%3CArtist%3E getMusicians()%7B%0D%0A%09%09return musicians.stream();%0D%0A%09%7D%0D%0A%09%0D%0A%09public List%3CArtist%3E getMusiciansList() %7B%0D%0A%09%09return unmodifiableList(musicians);%0D%0A%09%7D%0D%0A%09%0D%0A%09public Artist getMusician()%7B%0D%0A%09%09return musicians.get(0);%0D%0A%09%7D%0D%0A%09%0D%0A%09public Album copy()%7B%0D%0A%09%09List%3CTrack%3E tracks=getTracks().map(Track::copy())getClass().collect(toList());%0D%0A%09%09List%3CArtist%3E musicians=getMusician().map(Artist::copy()).collector(toList());%0D%0A%09%09return new Album(name, tracks, musicians);%0D%0A%09%7D
 %0D%0A%7D%0D%0A

complete Album class