OptimizationWaypoint implements Serializable { @NonNull public static Builder builder() { return new AutoValue_OptimizationWaypoint.Builder(); }  @NonNull static Builder builder(); @SerializedName("waypoint_index") abstract int waypointIndex(); @SerializedName("trips_index") abstract int tripsIndex(); @Nullable abstract String name(); @Nullable Point location(); abstract OptimizationWaypoint.Builder toBuilder(); static TypeAdapter<OptimizationWaypoint> typeAdapter(Gson gson);  }
@Test public void testSerializable() throws IOException, ClassNotFoundException { MapboxOptimization client = MapboxOptimization.builder() .coordinate(Point.fromLngLat(1.0, 1.0)) .coordinate(Point.fromLngLat(2.0, 2.0)) .baseUrl(mockUrl.toString()) .accessToken("pk.XXX") .build(); Response<OptimizationResponse> response = client.executeCall(); byte[] bytes = serialize(response.body().waypoints().get(0)); assertEquals(response.body().waypoints().get(0), deserialize(bytes, OptimizationWaypoint.class)); }