GuidanceSpeedData implements Parcelable { @NonNull @Override public String toString() { return "GuidanceSpeedData(mCurrentSpeed=" + this.mCurrentSpeed + ", mCurrentSpeedLimit=" + this.mCurrentSpeedLimit + ")"; } GuidanceSpeedData(Double speed, Double speedLimit); protected  GuidanceSpeedData(Parcel in); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); Double getCurrentSpeed(); Double getCurrentSpeedLimit(); boolean isSpeeding(); boolean isValid(); @NonNull @Override String toString(); @Override int hashCode(); @Override boolean equals(Object var1); static final Creator<GuidanceSpeedData> CREATOR; }
@Test public void testToString() { GuidanceSpeedData data = new GuidanceSpeedData(VELOCITY, SPEED_LIMIT); String expectedResult = "GuidanceSpeedData(mCurrentSpeed=60.0, mCurrentSpeedLimit=70.0)"; assertThat(data.toString(), is(expectedResult)); }