PictureFrame implements Metadata.Entry { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(pictureType); dest.writeString(mimeType); dest.writeString(description); dest.writeInt(width); dest.writeInt(height); dest.writeInt(depth); dest.writeInt(colors); dest.writeByteArray(pictureData); } PictureFrame(
      int pictureType,
      String mimeType,
      String description,
      int width,
      int height,
      int depth,
      int colors,
      byte[] pictureData);   PictureFrame(Parcel in); @Override String toString(); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); final int pictureType; final String mimeType; final String description; final int width; final int height; final int depth; final int colors; final byte[] pictureData; static final Parcelable.Creator<PictureFrame> CREATOR; }
@Test public void testParcelable() { PictureFrame pictureFrameToParcel = new PictureFrame(0, "", "", 0, 0, 0, 0, new byte[0]); Parcel parcel = Parcel.obtain(); pictureFrameToParcel.writeToParcel(parcel, 0); parcel.setDataPosition(0); PictureFrame pictureFrameFromParcel = PictureFrame.CREATOR.createFromParcel(parcel); assertThat(pictureFrameFromParcel).isEqualTo(pictureFrameToParcel); parcel.recycle(); }