App implements Parcelable, Comparable<App> { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.title); } App(String title); private  App(Parcel in); boolean matches(String filter); @Override int compareTo(App app); @Override boolean equals(Object o); @Override int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); final String title; static final Creator<App> CREATOR; }
@Test public void should_restore_from_parcelable() { App app = new App("MyTitle"); Parcel parcel = Parcel.obtain(); app.writeToParcel(parcel, 0); parcel.setDataPosition(0); App fromParcel = App.CREATOR.createFromParcel(parcel); assertThat(fromParcel.title).isEqualTo("MyTitle"); }