RouteLeg extends DirectionsJsonObject { @Nullable public abstract List<Admin> admins();  static Builder builder(); @Nullable abstract Double distance(); @Nullable abstract Double duration(); @Nullable @SerializedName("duration_typical") abstract Double durationTypical(); @Nullable abstract String summary(); @Nullable abstract List<Admin> admins(); @Nullable abstract List<LegStep> steps(); @Nullable abstract LegAnnotation annotation(); abstract Builder toBuilder(); static TypeAdapter<RouteLeg> typeAdapter(Gson gson); static RouteLeg fromJson(String json);  }
@Test public void testAdmins() { String routeLegJsonString = "{" + "\"distance\": 53.4," + "\"duration\": 14.3," + "\"summary\": \"route summary\"," + "\"admins\": [{ \"iso_3166_1_alpha3\": \"USA\", \"iso_3166_1\": \"US\" }]" + "}"; List<Admin> admins = new ArrayList<>(); admins.add(Admin.builder().countryCode("US").countryCodeAlpha3("USA").build()); RouteLeg routeLeg = RouteLeg.builder() .distance(53.4) .duration(14.3) .summary("route summary") .admins(admins) .build(); RouteLeg routeLegFromJson = RouteLeg.fromJson(routeLegJsonString); assertEquals(routeLeg, routeLegFromJson); assertEquals("US", routeLegFromJson.admins().get(0).countryCode()); assertEquals("USA", routeLegFromJson.admins().get(0).countryCodeAlpha3()); }