code: public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas, boolean replaceExistingSynonyms, RequestOptions requestOptions) throws AlgoliaException {
      JSONArray array = new JSONArray();
      for (JSONObject obj : objects) {
        array.put(obj);
      }
  
      return client.postRequest("/1/indexes/" + encodedIndexName + "/synonyms/batch?forwardToReplicas=" + forwardToReplicas + "&replaceExistingSynonyms=" + replaceExistingSynonyms, array.toString(), true, false, requestOptions);
    }
docs: Add or Replace a list of synonyms
  
  @param objects                 List of synonyms
  @param forwardToReplicas       Forward the operation to the replica indices
  @param replaceExistingSynonyms Replace the existing synonyms with this batch
  @param requestOptions          Options to pass to this request