IcyInfo implements Metadata.Entry { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeByteArray(rawMetadata); dest.writeString(title); dest.writeString(url); } IcyInfo(byte[] rawMetadata, @Nullable String title, @Nullable String url);   IcyInfo(Parcel in); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); @Override String toString(); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); final byte[] rawMetadata; @Nullable final String title; @Nullable final String url; static final Parcelable.Creator<IcyInfo> CREATOR; }
@Test public void parcelEquals() { IcyInfo streamInfo = new IcyInfo("StreamName='name';StreamUrl='url'".getBytes(UTF_8), "name", "url"); Parcel parcel = Parcel.obtain(); streamInfo.writeToParcel(parcel, 0); parcel.setDataPosition(0); IcyInfo fromParcelStreamInfo = IcyInfo.CREATOR.createFromParcel(parcel); assertThat(fromParcelStreamInfo).isEqualTo(streamInfo); }