docs: private void writeStrictFormatting(List<Object> list, Object paramExtractor, String scriptToUse) {
          if (HAS_SCRIPT) {
              /*
               * {
               *   "script":{
               *     "inline": "...",
               *     "lang": "...",
               *     "params": ...,
               *   },
               *   "upsert": {...}
               * }
               */
              list.add(scriptToUse);
              if (HAS_LANG) {
                  list.add(SCRIPT_LANG_5X);
              }
              if (paramExtractor != null) {
                  list.add(",\"params\":");
                  list.add(paramExtractor);
              }
              list.add("}");
              if (UPSERT) {
                  list.add(",\"upsert\":");
              }
          } else {
              /*
               * {
               *   "doc_as_upsert": true,
               *   "doc": {...}
               * }
               */
              list.add("{");
              if (UPSERT) {
                  list.add("\"doc_as_upsert\":true,");
              }
              list.add("\"doc\":");
          }
      }