UserLibraryImpl libraryMock = EasyMock.createMock(UserLibraryImpl.class);
TrackFactory trackFactoryMock = EasyMock.createMock(TrackFactory.class);
IITTrack itThrillerMock = EasyMock.createMock(IITTrack.class);
IITTrack itBeatItMock = EasyMock.createMock(IITTrack.class);
IITTrack itBillyJeanMock = EasyMock.createMock(IITTrack.class);
IITTrackCollection itTrackCollectionMock = EasyMock.createMock(IITTrackCollection.class);
TrackImpl thrillerMock = EasyMock.createMock(TrackImpl.class);
TrackImpl beatItMock = EasyMock.createMock(TrackImpl.class);
TrackImpl billyJeanMock = EasyMock.createMock(TrackImpl.class);
EasyMock.expect(libraryMock.isLazy()).andReturn(false).anyTimes();
EasyMock.expect(libraryMock.getTrackFactory()).andReturn(trackFactoryMock);
EasyMock.expect(trackFactoryMock.getTrack(itThrillerMock)).andReturn(thrillerMock);
EasyMock.expect(trackFactoryMock.getTrack(itBeatItMock)).andReturn(beatItMock);
EasyMock.expect(trackFactoryMock.getTrack(itBillyJeanMock)).andReturn(billyJeanMock);
EasyMock.expect(itTrackCollectionMock.itemByPlayOrder(1)).andReturn(itThrillerMock);
EasyMock.expect(itTrackCollectionMock.itemByPlayOrder(2)).andReturn(itBeatItMock);
EasyMock.expect(itTrackCollectionMock.itemByPlayOrder(3)).andReturn(itBillyJeanMock);
EasyMock.expect(itTrackCollectionMock.getCount()).andReturn(3l).times(4);
EasyMock.replay(libraryMock);
EasyMock.replay(trackFactoryMock);
EasyMock.replay(itThrillerMock);
EasyMock.replay(itBeatItMock);