@Test public void parcelWithNoPayload() { response.setPayload(null); Parcel parcel = Parcel.obtain(); response.writeToParcel(parcel, 0); parcel.setDataPosition(0); VehicleMessage createdFromParcel = VehicleMessage.CREATOR.createFromParcel(parcel); assertThat(createdFromParcel, instanceOf(DiagnosticResponse.class)); assertEquals(response, createdFromParcel); assertThat(response.getPayload(), nullValue()); }
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); out.writeSerializable(getNegativeResponseCode()); }
DiagnosticResponse extends DiagnosticMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); out.writeSerializable(getNegativeResponseCode()); } }
DiagnosticResponse extends DiagnosticMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); out.writeSerializable(getNegativeResponseCode()); } DiagnosticResponse(int busId, int id, int mode);  DiagnosticResponse(int busId, int id, int mode, int pid,
            byte[] payload);  DiagnosticResponse(int busId, int id, int mode, int pid,
            byte[] payload,
            NegativeResponseCode negativeResponseCode,
            double value); protected  DiagnosticResponse(Parcel in); protected  DiagnosticResponse(); }
DiagnosticResponse extends DiagnosticMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); out.writeSerializable(getNegativeResponseCode()); } DiagnosticResponse(int busId, int id, int mode);  DiagnosticResponse(int busId, int id, int mode, int pid,
            byte[] payload);  DiagnosticResponse(int busId, int id, int mode, int pid,
            byte[] payload,
            NegativeResponseCode negativeResponseCode,
            double value); protected  DiagnosticResponse(Parcel in); protected  DiagnosticResponse(); boolean isSuccessful(); boolean hasValue(); Double getValue(); void setValue(Double value); NegativeResponseCode getNegativeResponseCode(); void setNegativeResponseCode(NegativeResponseCode code); @Override String toString(); static boolean containsRequiredFields(Set<String> fields); @Override boolean equals(Object obj); @Override void writeToParcel(Parcel out, int flags); }
DiagnosticResponse extends DiagnosticMessage { @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeValue(getValue()); out.writeSerializable(getNegativeResponseCode()); } DiagnosticResponse(int busId, int id, int mode);  DiagnosticResponse(int busId, int id, int mode, int pid,
            byte[] payload);  DiagnosticResponse(int busId, int id, int mode, int pid,
            byte[] payload,
            NegativeResponseCode negativeResponseCode,
            double value); protected  DiagnosticResponse(Parcel in); protected  DiagnosticResponse(); boolean isSuccessful(); boolean hasValue(); Double getValue(); void setValue(Double value); NegativeResponseCode getNegativeResponseCode(); void setNegativeResponseCode(NegativeResponseCode code); @Override String toString(); static boolean containsRequiredFields(Set<String> fields); @Override boolean equals(Object obj); @Override void writeToParcel(Parcel out, int flags);  }