@Test(expected = NullPointerException.class) public void testFormatArtistAndAlbumNullRes() throws Exception { underTest.formatArtistAndAlbum(null, "a", "a"); }
@NonNull public String formatArtistAndAlbum(@NonNull final Resources res, @Nullable String artist, @Nullable String album) { if (TextUtils.isEmpty(artist)) { artist = res.getString(R.string.Unknown_artist); } if (TextUtils.isEmpty(album)) { album = res.getString(R.string.Unknown_album); } return artist + res.getString(R.string.artist_album_separator) + album; }
ArtistAlbumFormatter { @NonNull public String formatArtistAndAlbum(@NonNull final Resources res, @Nullable String artist, @Nullable String album) { if (TextUtils.isEmpty(artist)) { artist = res.getString(R.string.Unknown_artist); } if (TextUtils.isEmpty(album)) { album = res.getString(R.string.Unknown_album); } return artist + res.getString(R.string.artist_album_separator) + album; } }
ArtistAlbumFormatter { @NonNull public String formatArtistAndAlbum(@NonNull final Resources res, @Nullable String artist, @Nullable String album) { if (TextUtils.isEmpty(artist)) { artist = res.getString(R.string.Unknown_artist); } if (TextUtils.isEmpty(album)) { album = res.getString(R.string.Unknown_album); } return artist + res.getString(R.string.artist_album_separator) + album; }  }
ArtistAlbumFormatter { @NonNull public String formatArtistAndAlbum(@NonNull final Resources res, @Nullable String artist, @Nullable String album) { if (TextUtils.isEmpty(artist)) { artist = res.getString(R.string.Unknown_artist); } if (TextUtils.isEmpty(album)) { album = res.getString(R.string.Unknown_album); } return artist + res.getString(R.string.artist_album_separator) + album; }  @NonNull String formatArtistAndAlbum(@NonNull final Resources res,
            @Nullable String artist,
            @Nullable String album); }
ArtistAlbumFormatter { @NonNull public String formatArtistAndAlbum(@NonNull final Resources res, @Nullable String artist, @Nullable String album) { if (TextUtils.isEmpty(artist)) { artist = res.getString(R.string.Unknown_artist); } if (TextUtils.isEmpty(album)) { album = res.getString(R.string.Unknown_album); } return artist + res.getString(R.string.artist_album_separator) + album; }  @NonNull String formatArtistAndAlbum(@NonNull final Resources res,
            @Nullable String artist,
            @Nullable String album);  }