code: public ServiceCall<QueryEntitiesResponse> queryEntities(QueryEntitiesOptions queryEntitiesOptions) {
      Validator.notNull(queryEntitiesOptions, "queryEntitiesOptions cannot be null");
      String[] pathSegments = { "v1/environments", "collections", "query_entities" };
      String[] pathParameters = { queryEntitiesOptions.environmentId(), queryEntitiesOptions.collectionId() };
      RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
          pathParameters));
      builder.query("version", versionDate);
      Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "queryEntities");
      for (Entry<String, String> header : sdkHeaders.entrySet()) {
        builder.header(header.getKey(), header.getValue());
      }
      builder.header("Accept", "application/json");
      final JsonObject contentJson = new JsonObject();
      if (queryEntitiesOptions.feature() != null) {
        contentJson.addProperty("feature", queryEntitiesOptions.feature());
      }
      if (queryEntitiesOptions.entity() != null) {
        contentJson.add("entity", GsonSingleton.getGson().toJsonTree(queryEntitiesOptions.entity()));
      }
      if (queryEntitiesOptions.context() != null) {
        contentJson.add("context", GsonSingleton.getGson().toJsonTree(queryEntitiesOptions.context()));
      }
      if (queryEntitiesOptions.count() != null) {
        contentJson.addProperty("count", queryEntitiesOptions.count());
      }
      if (queryEntitiesOptions.evidenceCount() != null) {
        contentJson.addProperty("evidence_count", queryEntitiesOptions.evidenceCount());
      }
      builder.bodyJson(contentJson);
      return createServiceCall(builder.build(), ResponseConverterUtils.getObject(QueryEntitiesResponse.class));
    }
docs: Knowledge Graph entity query.
  
  See the [Knowledge Graph documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-kg#kg) for
  more details.
  
  @param queryEntitiesOptions the {@link QueryEntitiesOptions} containing the options for the call
  @return a {@link ServiceCall} with a response type of {@link QueryEntitiesResponse}