@Test public void writeAndReadFromParcel() { Parcel parcel = Parcel.obtain(); message.writeToParcel(parcel, 0); parcel.setDataPosition(0); VehicleMessage createdFromParcel = VehicleMessage.CREATOR.createFromParcel(parcel); assertThat(createdFromParcel, instanceOf(CanMessage.class)); assertEquals(message, createdFromParcel); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(getBusId()); out.writeInt(getId()); out.writeByteArray(getData()); }
CanMessage extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(getBusId()); out.writeInt(getId()); out.writeByteArray(getData()); } }
CanMessage extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(getBusId()); out.writeInt(getId()); out.writeByteArray(getData()); } CanMessage(int canBus, int id, byte[] data); protected  CanMessage(Parcel in); }
CanMessage extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(getBusId()); out.writeInt(getId()); out.writeByteArray(getData()); } CanMessage(int canBus, int id, byte[] data); protected  CanMessage(Parcel in); int getBusId(); int getId(); byte[] getData(); @Override MessageKey getKey(); static boolean containsRequiredFields(Set<String> fields); @Override int compareTo(VehicleMessage other); @Override boolean equals(Object obj); @Override String toString(); @Override void writeToParcel(Parcel out, int flags); @Override void readFromParcel(Parcel in); }
CanMessage extends KeyedMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(getBusId()); out.writeInt(getId()); out.writeByteArray(getData()); } CanMessage(int canBus, int id, byte[] data); protected  CanMessage(Parcel in); int getBusId(); int getId(); byte[] getData(); @Override MessageKey getKey(); static boolean containsRequiredFields(Set<String> fields); @Override int compareTo(VehicleMessage other); @Override boolean equals(Object obj); @Override String toString(); @Override void writeToParcel(Parcel out, int flags); @Override void readFromParcel(Parcel in);  }