import java.util.ArrayList; public class SongArtistTester { public SongArtistTester() { //red hot chilli peppers Artist redHotChilliPeppers = new Artist("Red Hot Chili Peppers") ; Song otherSide = new Song(redHotChilliPeppers , "Otherside" ); Song underTheBridge = new Song(redHotChilliPeppers , "Under The Bridge"); Song daniCA = new Song(redHotChilliPeppers , "Dani California" ); redHotChilliPeppers.addSong( otherSide ); redHotChilliPeppers.addSong( daniCA ); redHotChilliPeppers.addSong( new Song(redHotChilliPeppers , "Snow")) ; redHotChilliPeppers.addSong( new Song(redHotChilliPeppers , "Don't Forget Me") ); /// ArrayList chilliSongs = redHotChilliPeppers.getSongs(); int wrong = 0; int correct = 0; if(chilliSongs.size() == 4 ) correct++; else { wrong++; p("Artist's getSong() message seems problematic"); } if(chilliSongs.get(0).getName().equals("Otherside")) { correct++; } else { wrong++; p("Error involving getName() of Song "); } if(redHotChilliPeppers.equals(new Artist(redHotChilliPeppers.getName()))) correct++; else { wrong++; p("Error involving equals() method of Artist"); } //focus on Song class if(underTheBridge.getName().equals("Under The Bridge" )) correct++; else { wrong++; p("Error involving getName() method of Song"); } if(underTheBridge.getArtist().equals(redHotChilliPeppers)) correct++; else { wrong++; p("Error involving getArritst() of Song or equals() method of Artist"); } p("**************************************************"); p("No Wrong : " + wrong); p("No correct : " + correct); p("**************************************************"); p("**************************************************"); p("Note: toString(),among other aspects of your code, will be examined manually by me "); p("toString() must follow the conventions we have discussed"); p("Also, make sure you have : \n\t * used descriptive variable names ") ; p("\n\t * made all variables private ") ; p("\n\t * and followed other conventions we have been using."); p("**************************************************"); p("**************************************************"); } void p(String s){ System.out.println(s) ; } void p(int s){ System.out.println(s) ; } void p(boolean s){ System.out.println(s) ; }