ArtInfo implements Parcelable, Comparable<ArtInfo> { @Override public int hashCode() { int result = artistName != null ? artistName.hashCode() : 0; result = 31 * result + (albumName != null ? albumName.hashCode() : 0); result = 31 * result + (artworkUri != null ? artworkUri.hashCode() : 0); result = 31 * result + (forArtist ? 1 : 0); return result; } @Deprecated  ArtInfo(String artistName, String albumName, Uri artworkUri); private  ArtInfo(String artistName, String albumName, Uri artworkUri, boolean forArtist); static ArtInfo forAlbum(String artistName, String albumName, Uri artworkUri); static ArtInfo forArtist(String artistName, Uri artworkUri); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String cacheKey(); Uri asContentUri(String authority); Uri asUri(Uri base); static ArtInfo fromUri(Uri uri); @Override int compareTo(ArtInfo another); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final ArtInfo NULLINSTANCE; final String artistName; final String albumName; final Uri artworkUri; final boolean forArtist; static final Creator<ArtInfo> CREATOR; }
@Test public void ensureArtInfoHashCodeWorks() { assertThat(artInfo1.hashCode()).isEqualTo(artInfo1_copy.hashCode()); assertThat(artInfo1.hashCode()).isNotEqualTo(artInfo2.hashCode()); }