### Question:
AppNotification implements Parcelable { @Override public void writeToParcel(Parcel parcel, int i) { parcel.writeString(toJson().toString()); } AppNotification(String appEvent, String payload);  AppNotification(JSONObject json);  AppNotification(Intent intent); @Override String toString(); JSONObject toJson(); @Override int describeContents(); @Override void writeToParcel(Parcel parcel, int i); @Override boolean equals(Object o); @Override int hashCode(); static final int MAX_PAYLOAD_LENGTH; final String appEvent; final String payload; static final Parcelable.Creator<AppNotification> CREATOR; }### Answer:
@Test public void testParcelable() throws Exception { AppNotification expected = new AppNotification("sale", "Sunday"); Parcel p = Parcel.obtain(); expected.writeToParcel(p, 0); p.setDataPosition(0); AppNotification actual = AppNotification.CREATOR.createFromParcel(p); Assert.assertEquals(expected, actual); }