code: private void write(ContentResult contentResult) throws IOException {
          if (contentResult.getName() != null) {
              openCurlyBracket();
              writeName(contentResult.getName());
          }
          if (contentResult.isEmpty()) {
              writeNull();
          } else if (contentResult.size() == 1) {
              ActionResult actionResult = contentResult.get(0);
              if (actionResult.getActionId() != null) {
                  openCurlyBracket();
                  writeName(actionResult.getActionId());
                  write(actionResult.getResultValue());
                  closeCurlyBracket();
              } else {
                  write(actionResult.getResultValue());
              }
          } else {
              openCurlyBracket();
              int cnt = 0;
              for (String actionId : contentResult.getActionIds()) {
                  if (cnt++ > 0) {
                      writeComma();
                  }
                  ActionResult actionResult = contentResult.getActionResult(actionId);
                  writeName(actionResult.getActionId());
                  write(actionResult.getResultValue());
              }
              closeCurlyBracket();
          }
          if (contentResult.getName() != null) {
              closeCurlyBracket();
          }
      }
docs: Write a {@code ContentResult} object to the character-output stream.
  
  @param contentResult the {@code ContentResult} object to write to a character-output stream.
  @throws IOException if an I/O error has occurred