LanguageTranslator extends BaseService { public ServiceCall<IdentifiedLanguages> identify(IdentifyOptions identifyOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( identifyOptions, "identifyOptions cannot be null"); String[] pathSegments = {"v3/identify"}; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("language_translator", "v3", "identify"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.bodyContent(identifyOptions.text(), "text/plain"); ResponseConverter<IdentifiedLanguages> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<IdentifiedLanguages>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } LanguageTranslator(String versionDate);  LanguageTranslator(String versionDate, Authenticator authenticator);  LanguageTranslator(String versionDate, String serviceName);  LanguageTranslator(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<Languages> listLanguages(ListLanguagesOptions listLanguagesOptions); ServiceCall<Languages> listLanguages(); ServiceCall<TranslationResult> translate(TranslateOptions translateOptions); ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(
      ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions); ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(); ServiceCall<IdentifiedLanguages> identify(IdentifyOptions identifyOptions); ServiceCall<TranslationModels> listModels(ListModelsOptions listModelsOptions); ServiceCall<TranslationModels> listModels(); ServiceCall<TranslationModel> createModel(CreateModelOptions createModelOptions); ServiceCall<DeleteModelResult> deleteModel(DeleteModelOptions deleteModelOptions); ServiceCall<TranslationModel> getModel(GetModelOptions getModelOptions); ServiceCall<DocumentList> listDocuments(ListDocumentsOptions listDocumentsOptions); ServiceCall<DocumentList> listDocuments(); ServiceCall<DocumentStatus> translateDocument(
      TranslateDocumentOptions translateDocumentOptions); ServiceCall<DocumentStatus> getDocumentStatus(
      GetDocumentStatusOptions getDocumentStatusOptions); ServiceCall<Void> deleteDocument(DeleteDocumentOptions deleteDocumentOptions); ServiceCall<InputStream> getTranslatedDocument(
      GetTranslatedDocumentOptions getTranslatedDocumentOptions);  }
@Test public void testIdentify() throws InterruptedException { server.enqueue(jsonResponse(identifiedLanguages)); final String text = texts.get(0); IdentifyOptions identifyOptions = new IdentifyOptions.Builder(text).build(); List<IdentifiedLanguage> identifiedLanguages = service.identify(identifyOptions).execute().getResult().getLanguages(); RecordedRequest request = server.takeRequest(); assertEquals(IDENTITY_PATH + VERSION_PARAM, request.getPath()); assertEquals("POST", request.getMethod()); assertEquals(text, request.getBody().readUtf8()); assertNotNull(identifiedLanguages); assertFalse(identifiedLanguages.isEmpty()); assertEquals(identifiedLanguages.get(0).getLanguage(), Language.ENGLISH); assertEquals(identifiedLanguages.get(0).getConfidence(), 0.877159, 0.05); assertEquals(identifiedLanguages.get(1).getLanguage(), Language.AFRIKAANS); assertEquals(identifiedLanguages.get(1).getConfidence(), 0.0752636, 0.05); }