CoordinatesConverter { @TypeConverter public String fromCoordinates(Coordinates coordinates) { return new Gson().toJson(coordinates); }  @TypeConverter String fromCoordinates(Coordinates coordinates); @TypeConverter Coordinates fromString(String value);  }
@Test public void fromCoordinatesThenConvertToGson() { Coordinates coordinates = new Coordinates(1D, 1D); String result = new CoordinatesConverter().fromCoordinates(coordinates); assertEquals("{\"lat\":1.0,\"lon\":1.0}", result); }