@Test void testToString() { assertThat(this.artist.toString(), equalTo(NAME + " in the genre: Rock, Pop, ")); this.artist = new ArtistEntity(); assertThat(this.artist.toString(), equalTo("No artist data is available")); }
@Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); if (getName() != null) { stringBuilder.append(getName()); if (this.genres != null) { stringBuilder = stringBuilder.append(" in the genre: "); for (String genre : this.genres) { stringBuilder.append(genre).append(", "); } } return stringBuilder.toString(); } return "No artist data is available"; }
ArtistEntity extends Item { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); if (getName() != null) { stringBuilder.append(getName()); if (this.genres != null) { stringBuilder = stringBuilder.append(" in the genre: "); for (String genre : this.genres) { stringBuilder.append(genre).append(", "); } } return stringBuilder.toString(); } return "No artist data is available"; } }
ArtistEntity extends Item { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); if (getName() != null) { stringBuilder.append(getName()); if (this.genres != null) { stringBuilder = stringBuilder.append(" in the genre: "); for (String genre : this.genres) { stringBuilder.append(genre).append(", "); } } return stringBuilder.toString(); } return "No artist data is available"; }  }
ArtistEntity extends Item { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); if (getName() != null) { stringBuilder.append(getName()); if (this.genres != null) { stringBuilder = stringBuilder.append(" in the genre: "); for (String genre : this.genres) { stringBuilder.append(genre).append(", "); } } return stringBuilder.toString(); } return "No artist data is available"; }  String[] getGenre(); void setGenre(String[] genres); @Override String toString(); }
ArtistEntity extends Item { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); if (getName() != null) { stringBuilder.append(getName()); if (this.genres != null) { stringBuilder = stringBuilder.append(" in the genre: "); for (String genre : this.genres) { stringBuilder.append(genre).append(", "); } } return stringBuilder.toString(); } return "No artist data is available"; }  String[] getGenre(); void setGenre(String[] genres); @Override String toString();  }