Skip to content

Instantly share code, notes, and snippets.

@priort
Created December 30, 2018 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priort/492c1ce647ff92162ab1b93810c09d84 to your computer and use it in GitHub Desktop.
Save priort/492c1ce647ff92162ab1b93810c09d84 to your computer and use it in GitHub Desktop.
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