code: static boolean addListToJSON(StringBuilder sb, String name, Object[] list, boolean jsonEscapeValues, boolean isFirstField) {
          if (name == null || list == null)
              return false;
  
          // add comma if isFirstField == false
          if (!isFirstField)
              sb.append(",");
  
          sb.append("\"" + name + "\":[");
          boolean firstParm = true;
          for (Object element : list) {
              if (firstParm)
                  sb.append("\"");
              else
                  sb.append(",\"");
              if (element != null) {
                  if (jsonEscapeValues)
                      sb.append(jsonEscape2(element.toString()));
                  else
                      sb.append(element.toString());
              }
              sb.append("\"");
              firstParm = false;
          }
          sb.append("]");
          return true;
      }
docs: /*
  returns true if name value pair was added to the string buffer