@Test
 public void test_getToolTipText() throws Exception {
   // setup
   final TinyAudioPlayer player = mock(TinyAudioPlayer.class);
   final PlaylistItemTag tag =
       playlistItemTag() //
           .channels(2) //
           .samplingRate(44100) //
           .bitRate(192000) //
           .album("Album 01")
           .genre("Audiobook")
           .year("2002")
           .build();
   final PlaylistItem item =
       spy(new PlaylistItem("Track 01", new File("01 - Track 01.mp3").toURI(), 220));
   doReturn(tag).when(item).getInfoTag();
   final PlaylistItemLabelProvider labelProvider = new PlaylistItemLabelProvider(player);
   // run
   final String tooltip = labelProvider.getToolTipText(item);
   // assert
   assertThat(tooltip)
       .isEqualTo(
           "album: Album 01\n"
               + //
               "genre: Audiobook\n"
               + //
               "year: 2002\n"
               + //
               "channels: stereo\n"
               + //
               "sampling rate: 44100 Hz\n"
               + //
               "bitrate: 192000 bit/s");
 }
 @Test
 public void whenInvoked_update_shouldUseDisplayNameAsText() throws Exception {
   // setup
   final TinyAudioPlayer player = mock(TinyAudioPlayer.class);
   doReturn(mock(Playlist.class)).when(player).getPlaylist();
   final PlaylistItemLabelProvider labelProvider = new PlaylistItemLabelProvider(player);
   final PlaylistItem item = mock(PlaylistItem.class);
   doReturn("Text").when(item).getDisplayableName();
   final ViewerCell cell = mock(ViewerCell.class);
   doReturn(item).when(cell).getElement();
   // run
   labelProvider.update(cell);
   // assert
   verify(cell).setText("Text");
 }
 @Test
 public void whenInvokedNormalCell_update_shouldUseWhiteBackground() throws Exception {
   // setup
   final TinyAudioPlayer player = mock(TinyAudioPlayer.class);
   final PlaylistItem item = mock(PlaylistItem.class);
   doReturn("Text").when(item).getDisplayableName();
   final Playlist playlist = mock(Playlist.class);
   doReturn(false).when(playlist).isEmpty();
   doReturn(mock(PlaylistItem.class)).when(playlist).getCurrentTrack();
   doReturn(playlist).when(player).getPlaylist();
   final PlaylistItemLabelProvider labelProvider = new PlaylistItemLabelProvider(player);
   final ViewerCell cell = mock(ViewerCell.class);
   doReturn(item).when(cell).getElement();
   // run
   labelProvider.update(cell);
   // assert
   verify(cell).setBackground(eq(new Color(null, WHITE)));
 }
 @Test
 public void test_getToolTipText_unknown() throws Exception {
   // setup
   final TinyAudioPlayer player = mock(TinyAudioPlayer.class);
   final PlaylistItem item =
       new PlaylistItem("Track 01", new File("01 - Track 01.mp3").toURI(), -1);
   final PlaylistItemLabelProvider labelProvider = new PlaylistItemLabelProvider(player);
   // run
   final String tooltip = labelProvider.getToolTipText(item);
   // assert
   assertThat(tooltip)
       .isEqualTo(
           "channels: unknown\n"
               + //
               "sampling rate: unknown\n"
               + //
               "bitrate: unknown");
 }