@Test public void ensureSongHashCodeWorks() { assertThat(song1.hashCode()).isEqualTo(song1_copy.hashCode()); assertThat(song1.hashCode()).isNotEqualTo(song2.hashCode()); }
@Override public int hashCode() { int result = identity != null ? identity.hashCode() : 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (albumName != null ? albumName.hashCode() : 0); result = 31 * result + (artistName != null ? artistName.hashCode() : 0); result = 31 * result + (albumArtistName != null ? albumArtistName.hashCode() : 0); result = 31 * result + (albumIdentity != null ? albumIdentity.hashCode() : 0); result = 31 * result + duration; result = 31 * result + (dataUri != null ? dataUri.hashCode() : 0); result = 31 * result + (artworkUri != null ? artworkUri.hashCode() : 0); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); return result; }
Song implements Bundleable { @Override public int hashCode() { int result = identity != null ? identity.hashCode() : 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (albumName != null ? albumName.hashCode() : 0); result = 31 * result + (artistName != null ? artistName.hashCode() : 0); result = 31 * result + (albumArtistName != null ? albumArtistName.hashCode() : 0); result = 31 * result + (albumIdentity != null ? albumIdentity.hashCode() : 0); result = 31 * result + duration; result = 31 * result + (dataUri != null ? dataUri.hashCode() : 0); result = 31 * result + (artworkUri != null ? artworkUri.hashCode() : 0); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); return result; } }
Song implements Bundleable { @Override public int hashCode() { int result = identity != null ? identity.hashCode() : 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (albumName != null ? albumName.hashCode() : 0); result = 31 * result + (artistName != null ? artistName.hashCode() : 0); result = 31 * result + (albumArtistName != null ? albumArtistName.hashCode() : 0); result = 31 * result + (albumIdentity != null ? albumIdentity.hashCode() : 0); result = 31 * result + duration; result = 31 * result + (dataUri != null ? dataUri.hashCode() : 0); result = 31 * result + (artworkUri != null ? artworkUri.hashCode() : 0); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); return result; } protected  Song(@NonNull String identity,
                @NonNull String name,
                @Nullable String albumName,
                @Nullable String artistName,
                @Nullable String albumArtistName,
                @Nullable String albumIdentity,
                int duration,
                @NonNull Uri dataUri,
                @Nullable Uri artworkUri,
                @Nullable String mimeType); }
Song implements Bundleable { @Override public int hashCode() { int result = identity != null ? identity.hashCode() : 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (albumName != null ? albumName.hashCode() : 0); result = 31 * result + (artistName != null ? artistName.hashCode() : 0); result = 31 * result + (albumArtistName != null ? albumArtistName.hashCode() : 0); result = 31 * result + (albumIdentity != null ? albumIdentity.hashCode() : 0); result = 31 * result + duration; result = 31 * result + (dataUri != null ? dataUri.hashCode() : 0); result = 31 * result + (artworkUri != null ? artworkUri.hashCode() : 0); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); return result; } protected  Song(@NonNull String identity,
                @NonNull String name,
                @Nullable String albumName,
                @Nullable String artistName,
                @Nullable String albumArtistName,
                @Nullable String albumIdentity,
                int duration,
                @NonNull Uri dataUri,
                @Nullable Uri artworkUri,
                @Nullable String mimeType); @Override String getIdentity(); @Override String getName(); @Override Bundle toBundle(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Builder builder(); }
Song implements Bundleable { @Override public int hashCode() { int result = identity != null ? identity.hashCode() : 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (albumName != null ? albumName.hashCode() : 0); result = 31 * result + (artistName != null ? artistName.hashCode() : 0); result = 31 * result + (albumArtistName != null ? albumArtistName.hashCode() : 0); result = 31 * result + (albumIdentity != null ? albumIdentity.hashCode() : 0); result = 31 * result + duration; result = 31 * result + (dataUri != null ? dataUri.hashCode() : 0); result = 31 * result + (artworkUri != null ? artworkUri.hashCode() : 0); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); return result; } protected  Song(@NonNull String identity,
                @NonNull String name,
                @Nullable String albumName,
                @Nullable String artistName,
                @Nullable String albumArtistName,
                @Nullable String albumIdentity,
                int duration,
                @NonNull Uri dataUri,
                @Nullable Uri artworkUri,
                @Nullable String mimeType); @Override String getIdentity(); @Override String getName(); @Override Bundle toBundle(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Builder builder(); static final String DEFAULT_MIME_TYPE; final String identity; final String name; final String albumName; final String artistName; final String albumArtistName; final String albumIdentity; final int duration; final Uri dataUri; final Uri artworkUri; final String mimeType; static final BundleCreator<Song> BUNDLE_CREATOR; }