@Test public void serializeWithExtras() { HashMap<String, Object> extras = new HashMap<>(); extras.put("foo", "bar"); extras.put("baz", 42.0); String actualJson = JsonFormatter.serialize(new VehicleMessage(extras)); assertTrue(actualJson.contains("foo") && actualJson.contains("bar")&&actualJson.contains("baz") && actualJson.contains("42.0")); }
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);  }