@Test public void defaultsNotIncluded() { DiagnosticRequest request = new DiagnosticRequest(1, 2, 3, 4); String serialized = JsonFormatter.serialize(request); assertThat(serialized, not(containsString("frequency"))); assertThat(serialized, not(containsString("name"))); assertThat(serialized, not(containsString("payload"))); assertThat(serialized, not(containsString("multiple_responses"))); request.setMultipleResponses(false); serialized = JsonFormatter.serialize(request); assertThat(serialized, containsString("multiple_responses")); }
public static String serialize(VehicleMessage message) { return sGson.toJson(message); }
JsonFormatter { public static String serialize(VehicleMessage message) { return sGson.toJson(message); } }
JsonFormatter { public static String serialize(VehicleMessage message) { return sGson.toJson(message); }  }
JsonFormatter { public static String serialize(VehicleMessage message) { return sGson.toJson(message); }  static String serialize(VehicleMessage message); static String serialize(Collection<VehicleMessage> messages); static VehicleMessage deserialize(String data); }
JsonFormatter { public static String serialize(VehicleMessage message) { return sGson.toJson(message); }  static String serialize(VehicleMessage message); static String serialize(Collection<VehicleMessage> messages); static VehicleMessage deserialize(String data);  }