@@ -0,0 +1,2605 @@
+package com.github.bjoernpetersen.jmusicbot.playback;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.junit.jupiter.api.Assertions.assertFalse;%0Aimport static org.junit.jupiter.api.Assertions.assertNotNull;%0Aimport static org.junit.jupiter.api.Assertions.assertSame;%0Aimport static org.junit.jupiter.api.Assertions.assertThrows;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0A%0Aimport com.github.bjoernpetersen.jmusicbot.Song;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.Optional;%0Aimport javax.annotation.Nonnull;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.params.ParameterizedTest;%0Aimport org.junit.jupiter.params.provider.MethodSource;%0A%0Aclass PlayerStateTest %7B%0A%0A  @Nonnull%0A  private static Song mockSong() %7B%0A    return mock(Song.class);%0A  %7D%0A%0A  @Test%0A  void play() %7B%0A    Song song = mockSong();%0A    PlayerState state = PlayerState.play(song);%0A%0A    assertSame(PlayerState.State.PLAY, state.getState());%0A    Optional%3CSong%3E songOptional = state.getSong();%0A    assertTrue(songOptional.isPresent());%0A    assertEquals(song, songOptional.get());%0A    assertSame(song, songOptional.get());%0A  %7D%0A%0A  @Test%0A  void playNullSong() %7B%0A    assertThrows(NullPointerException.class, () -%3E PlayerState.play(null));%0A  %7D%0A%0A  @Test%0A  void pause() %7B%0A    Song song = mockSong();%0A    PlayerState state = PlayerState.pause(song);%0A%0A    assertSame(PlayerState.State.PAUSE, state.getState());%0A    Optional%3CSong%3E songOptional = state.getSong();%0A    assertTrue(songOptional.isPresent());%0A    assertEquals(song, songOptional.get());%0A    assertSame(song, songOptional.get());%0A  %7D%0A%0A  @Test%0A  void pauseNullSong() %7B%0A    assertThrows(NullPointerException.class, () -%3E PlayerState.pause(null));%0A  %7D%0A%0A  @Test%0A  void stop() %7B%0A    assertSame(PlayerState.State.STOP, PlayerState.stop().getState());%0A  %7D%0A%0A  @Test%0A  void stopNoSong() %7B%0A    assertFalse(PlayerState.stop().getSong().isPresent());%0A  %7D%0A%0A  @Test%0A  void error() %7B%0A    assertSame(PlayerState.State.ERROR, PlayerState.error().getState());%0A  %7D%0A%0A  @Test%0A  void errorNoSong() %7B%0A    assertFalse(PlayerState.error().getSong().isPresent());%0A  %7D%0A%0A  @SuppressWarnings(%22unused%22) // used as MethodSource%0A  private static List%3CPlayerState%3E getPossibleStates() %7B%0A    Song song = mockSong();%0A    return Arrays.asList(%0A        PlayerState.play(song), PlayerState.pause(song),%0A        PlayerState.stop(), PlayerState.error()%0A    );%0A  %7D%0A%0A  @ParameterizedTest%0A  @MethodSource(names = %22getPossibleStates%22)%0A  void getSongNotNull(PlayerState state) %7B%0A    assertNotNull(state.getSong());%0A  %7D%0A%7D%0A

Add PlayerState tests (#5)