Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class JazzBandTest {
@Test
public void bandCreatesMusicianWithAccessToBandSetList() {
List setList = Arrays.asList("Donna Lee", "Dig");
JazzBand theBop5 = new JazzBand(setList);
JazzBand.Musician tom = theBop5.createMusician();
assertTrue(setList == tom.getBandSetList());
}
}
public class JazzBand {
private List setList;
public JazzBand(List setList) {
this.setList = setList;
}
public Musician createMusician() {
return new Musician();
}
public class Musician {
private Musician() {}
public List getBandSetList() {
return setList;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment