public class PlaylistUtilitiesTest {
@Test
public void testGetAllGenres() {
Playlist playlistMock = EasyMock.createMock(Playlist.class);
TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
Set<Track> tracks = new HashSet<Track>();
Track trackMock1 = EasyMock.createMock(Track.class);
Track trackMock2 = EasyMock.createMock(Track.class);
Track trackMock3 = EasyMock.createMock(Track.class);
Genre genreMockA = EasyMock.createMock(Genre.class);
Genre genreMockB = EasyMock.createMock(Genre.class);
tracks.add(trackMock1);
tracks.add(trackMock2);
tracks.add(trackMock3);
EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);