StepIntersection extends DirectionsJsonObject { @Nullable @SerializedName("rest_stop") public abstract RestStop restStop();  static Builder builder(); @NonNull Point location(); @Nullable abstract List<Integer> bearings(); @Nullable abstract List<String> classes(); @Nullable abstract List<Boolean> entry(); @Nullable abstract Integer in(); @Nullable abstract Integer out(); @Nullable abstract List<IntersectionLanes> lanes(); @Nullable @SerializedName("geometry_index") abstract Integer geometryIndex(); @Nullable @SerializedName("is_urban") abstract Boolean isUrban(); @Nullable @SerializedName("admin_index") abstract Integer adminIndex(); @Nullable @SerializedName("rest_stop") abstract RestStop restStop(); @Nullable @SerializedName("toll_collection") abstract TollCollection tollCollection(); @Nullable @SerializedName("mapbox_streets_v8") abstract MapboxStreetsV8 mapboxStreetsV8(); @Nullable @SerializedName("tunnel_name") abstract String tunnelName(); abstract Builder toBuilder(); static TypeAdapter<StepIntersection> typeAdapter(Gson gson); static StepIntersection fromJson(String json);  }
@Test public void testRestStop() { String stepIntersectionJsonString = "{" + "\"location\": [ 13.426579, 52.508068 ]," + "\"rest_stop\": { \"type\": \"rest_area\" }" + "}"; StepIntersection stepIntersection = StepIntersection.fromJson(stepIntersectionJsonString); Assert.assertEquals("rest_area", stepIntersection.restStop().type()); String jsonStr = stepIntersection.toJson(); compareJson(stepIntersectionJsonString, jsonStr); }