NaturalLanguageClassifier extends BaseService { public ServiceCall<ClassificationCollection> classifyCollection( ClassifyCollectionOptions classifyCollectionOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( classifyCollectionOptions, "classifyCollectionOptions cannot be null"); String[] pathSegments = {"v1/classifiers", "classify_collection"}; String[] pathParameters = {classifyCollectionOptions.classifierId()}; RequestBuilder builder = RequestBuilder.post( RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters)); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("natural_language_classifier", "v1", "classifyCollection"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); final JsonObject contentJson = new JsonObject(); contentJson.add( "collection", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() .toJsonTree(classifyCollectionOptions.collection())); builder.bodyJson(contentJson); ResponseConverter<ClassificationCollection> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<ClassificationCollection>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } NaturalLanguageClassifier();  NaturalLanguageClassifier(Authenticator authenticator);  NaturalLanguageClassifier(String serviceName);  NaturalLanguageClassifier(String serviceName, Authenticator authenticator); ServiceCall<Classification> classify(ClassifyOptions classifyOptions); ServiceCall<ClassificationCollection> classifyCollection(
      ClassifyCollectionOptions classifyCollectionOptions); ServiceCall<Classifier> createClassifier(CreateClassifierOptions createClassifierOptions); ServiceCall<ClassifierList> listClassifiers(
      ListClassifiersOptions listClassifiersOptions); ServiceCall<ClassifierList> listClassifiers(); ServiceCall<Classifier> getClassifier(GetClassifierOptions getClassifierOptions); ServiceCall<Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions);  }
@Test public void testClassifyCollection() throws InterruptedException { final String path = String.format(CLASSIFY_COLLECTION_PATH, classifierId); server.enqueue(jsonResponse(classificationCollection)); ClassifyInput input1 = new ClassifyInput.Builder().text("How hot will it be today?").build(); ClassifyInput input2 = new ClassifyInput.Builder().text("Is it hot outside?").build(); List<ClassifyInput> inputCollection = Arrays.asList(input1, input2); ClassifyCollectionOptions classifyOptions = new ClassifyCollectionOptions.Builder() .classifierId(classifierId) .collection(inputCollection) .build(); final ClassificationCollection result = service.classifyCollection(classifyOptions).execute().getResult(); final RecordedRequest request = server.takeRequest(); assertEquals(path, request.getPath()); assertEquals("POST", request.getMethod()); assertEquals(classificationCollection, result); }