### Question:
PlayerLogic { public PlaylistEntity play() { List<PlaylistEntity> playLists; playLists = this.search.searchFeaturedPlaylists(5); if (!playLists.isEmpty()) { if (this.suppressed) { this.collectionUriToPlay = playLists.get(0).getUri(); this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION; } else { this.spotifyAPICalls.playListFromUri(playLists.get(0).getUri()); } return playLists.get(0); } this.logger.warn("no featured playlist found"); return null; }  URI firstTimeInit(String clientID, String clientSecret); URI firstTimeInit(); void inputAuthCode(String authCode); PlaylistEntity play(); PlaylistEntity playPlaylist(int playlistNumber, SearchTypes type); TrackEntity playTrack(int trackNumber); AlbumEntity playAlbum(int albumNumber); ArtistEntity playArtist(int artistNumber); boolean resume(); boolean pause(); boolean skip(); boolean back(); TrackEntity getCurrentSong(); int setVolume(String volumeString); int setVolume(int volume); int getVolume();  }### Answer:
@Test void testPlayEmptyList() { when(this.search.searchFeaturedPlaylists(5)).thenReturn(new ArrayList<>()); assertThat(this.playerLogic.play(), equalTo(null)); }
@Test void testPlayNotEmptyList() { initPlaylists(); when(this.search.searchFeaturedPlaylists(5)).thenReturn(this.playlistsOwnFormat); when(this.spotifyAPICalls.playListFromUri(any())).thenReturn(true); assertThat(this.playerLogic.play().getUri(), equalTo(ID1)); verify(this.spotifyAPICalls).playListFromUri(ID1); }