@Test public void testEquality() { GuidanceManeuverData data = new GuidanceManeuverData(ICON_ID, DISTANCE, INFO1, INFO2); assertThat(mManeuverData, is(data)); GuidanceManeuverData data1 = new GuidanceManeuverData(0, DISTANCE, INFO1, INFO2); assertThat(mManeuverData, is(not(data1))); assertThat(null, is(not(mManeuverData))); assertThat(mManeuverData.hashCode(), is(data.hashCode())); GuidanceManeuverData data2 = new GuidanceManeuverData(ICON_ID, DISTANCE, INFO1, INFO2, NEXT_ROAD_ICON); assertThat(data2, is(mManeuverDataWithNextRoadIcon)); assertThat(mManeuverDataWithNextRoadIcon.hashCode(), is(data2.hashCode())); }
@Override public int hashCode() { return (((this.mIconId * 31 + (int) (this.mDistance ^ this.mDistance >>> 32)) * 31 + (this.mInfo1 == null ? 0 : this.mInfo1.hashCode())) * 31 + (this.mInfo2 == null ? 0 : this.mInfo2.hashCode())) * 31 + (this.mNextRoadIcon == null ? 0 : this.mNextRoadIcon.hashCode()) * 31; }
GuidanceManeuverData implements Parcelable { @Override public int hashCode() { return (((this.mIconId * 31 + (int) (this.mDistance ^ this.mDistance >>> 32)) * 31 + (this.mInfo1 == null ? 0 : this.mInfo1.hashCode())) * 31 + (this.mInfo2 == null ? 0 : this.mInfo2.hashCode())) * 31 + (this.mNextRoadIcon == null ? 0 : this.mNextRoadIcon.hashCode()) * 31; } }
GuidanceManeuverData implements Parcelable { @Override public int hashCode() { return (((this.mIconId * 31 + (int) (this.mDistance ^ this.mDistance >>> 32)) * 31 + (this.mInfo1 == null ? 0 : this.mInfo1.hashCode())) * 31 + (this.mInfo2 == null ? 0 : this.mInfo2.hashCode())) * 31 + (this.mNextRoadIcon == null ? 0 : this.mNextRoadIcon.hashCode()) * 31; } GuidanceManeuverData(int iconId, Long distance, String info1, String info2);  GuidanceManeuverData(int iconId, Long distance, String info1, String info2, Bitmap nextRoadIcon);   GuidanceManeuverData(Parcel in); }
GuidanceManeuverData implements Parcelable { @Override public int hashCode() { return (((this.mIconId * 31 + (int) (this.mDistance ^ this.mDistance >>> 32)) * 31 + (this.mInfo1 == null ? 0 : this.mInfo1.hashCode())) * 31 + (this.mInfo2 == null ? 0 : this.mInfo2.hashCode())) * 31 + (this.mNextRoadIcon == null ? 0 : this.mNextRoadIcon.hashCode()) * 31; } GuidanceManeuverData(int iconId, Long distance, String info1, String info2);  GuidanceManeuverData(int iconId, Long distance, String info1, String info2, Bitmap nextRoadIcon);   GuidanceManeuverData(Parcel in); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); int getIconId(); String getInfo1(); String getInfo2(); Long getDistance(); Bitmap getNextRoadIcon(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj1); }
GuidanceManeuverData implements Parcelable { @Override public int hashCode() { return (((this.mIconId * 31 + (int) (this.mDistance ^ this.mDistance >>> 32)) * 31 + (this.mInfo1 == null ? 0 : this.mInfo1.hashCode())) * 31 + (this.mInfo2 == null ? 0 : this.mInfo2.hashCode())) * 31 + (this.mNextRoadIcon == null ? 0 : this.mNextRoadIcon.hashCode()) * 31; } GuidanceManeuverData(int iconId, Long distance, String info1, String info2);  GuidanceManeuverData(int iconId, Long distance, String info1, String info2, Bitmap nextRoadIcon);   GuidanceManeuverData(Parcel in); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); int getIconId(); String getInfo1(); String getInfo2(); Long getDistance(); Bitmap getNextRoadIcon(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj1); static final Creator<GuidanceManeuverData> CREATOR; }