code: static void putAdditionalFieldsIntoJsonObject(
              @Nullable JSONObject jsonObject,
              @Nullable Map<String, Object> additionalFields) {
          if (jsonObject == null || additionalFields == null || additionalFields.isEmpty()) {
              return;
          }
  
          for (String key : additionalFields.keySet()) {
              try {
                  if (additionalFields.get(key) != null) {
                      jsonObject.put(key, additionalFields.get(key));
                  }
              } catch (JSONException ignored) { }
          }
      }
docs: Put the key-value pairs from the map into the JSON Object. Note: this does
  not protect against overwriting original values in the JSON. This method assumes
  a 1-level map.
  
  @param jsonObject a {@link JSONObject} into which new values are being written
  @param additionalFields a {@link Map} of key-value pairs to add to the object.