@Test public void testTimestampParcelable() { Timestamp timestamp = new Timestamp(1234L, 4567); Parcel parcel = Parcel.obtain(); timestamp.writeToParcel(parcel, 0); parcel.setDataPosition(0); Timestamp recreated = Timestamp.CREATOR.createFromParcel(parcel); assertThat(recreated).isEqualTo(timestamp); parcel.recycle(); }
@Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeLong(this.seconds); dest.writeInt(this.nanoseconds); }
Timestamp implements Comparable<Timestamp>, Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeLong(this.seconds); dest.writeInt(this.nanoseconds); } }
Timestamp implements Comparable<Timestamp>, Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeLong(this.seconds); dest.writeInt(this.nanoseconds); } Timestamp(long seconds, int nanoseconds); protected  Timestamp(@NonNull Parcel in);  Timestamp(@NonNull Date date); }
Timestamp implements Comparable<Timestamp>, Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeLong(this.seconds); dest.writeInt(this.nanoseconds); } Timestamp(long seconds, int nanoseconds); protected  Timestamp(@NonNull Parcel in);  Timestamp(@NonNull Date date); @NonNull static Timestamp now(); long getSeconds(); int getNanoseconds(); @NonNull Date toDate(); @Override int describeContents(); @Override void writeToParcel(@NonNull Parcel dest, int flags); @Override int compareTo(@NonNull Timestamp other); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
Timestamp implements Comparable<Timestamp>, Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeLong(this.seconds); dest.writeInt(this.nanoseconds); } Timestamp(long seconds, int nanoseconds); protected  Timestamp(@NonNull Parcel in);  Timestamp(@NonNull Date date); @NonNull static Timestamp now(); long getSeconds(); int getNanoseconds(); @NonNull Date toDate(); @Override int describeContents(); @Override void writeToParcel(@NonNull Parcel dest, int flags); @Override int compareTo(@NonNull Timestamp other); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); @NonNull
  static final Parcelable.Creator<Timestamp> CREATOR; }