MiscellaneousResource extends Resource { public CallSpec<Map<Language, List<Industry>>, HttpError> getTranslatedIndustries(Language language) { return Resource.<Map<Language, List<Industry>>, HttpError>newGetSpec(api, "/v1/misc/industries") .responseAs(newParameterizedType(Map.class, Language.class, newParameterizedType(List.class, Industry.class))) .queryParam("languages", language) .build(); } MiscellaneousResource(XingApi api); CallSpec<Map<Language, List<Industry>>, HttpError> getTranslatedIndustries(Language language);  }
@Test public void getTranslatedIndustries() throws Exception { server.enqueue(new MockResponse().setBody(file("industries.json"))); Response<Map<Language, List<Industry>>, HttpError> response = resource.getTranslatedIndustries(null).execute(); assertThat(response.isSuccessful()).isTrue(); List<Industry> industries = response.body().get(Language.EN); assertThat(industries.size()).isEqualTo(23); assertThat(industries.get(5).id()).isEqualTo(190000); assertThat(industries.get(5).segments().size()).isEqualTo(6); }