EasyMock.replay(libraryMock);
EasyMock.replay(trackCollectionMock);
EasyMock.replay(trackFactoryMock);
Artist albumArtist = ArtistImpl.create("Nelly Furtado", libraryMock);
Album loose = new AlbumImpl("Loose", albumArtist, libraryMock);
Album folklore = new AlbumImpl("Folklore", albumArtist, libraryMock);
EasyMock.reset(libraryMock);
EasyMock.expect(libraryMock.getAlbum("Loose", albumArtist)).andReturn(loose);
EasyMock.expect(libraryMock.getAlbum("Loose", albumArtist)).andReturn(loose);
EasyMock.expect(libraryMock.getAlbum("Folklore", albumArtist)).andReturn(folklore);
EasyMock.replay(libraryMock);
Album album1 = libraryMock.getAlbum("Loose", albumArtist);
assertTrue(album1.getName().equals("Loose"));
assertTrue(album1.getAlbumArtist().getName().equals("Nelly Furtado"));
Album album2 = libraryMock.getAlbum("Loose", albumArtist);
assertTrue(album1.equals(album2));
assertTrue(album1.equals(album1));
Album album3 = libraryMock.getAlbum("Folklore", albumArtist);
assertTrue(!album1.equals(album3));
}