code: protected Object serializeArgumentToJson(Object pArg) {
          if (pArg == null) {
              return null;
          } else if (pArg instanceof JSONAware) {
              return pArg;
          } else if (pArg.getClass().isArray()) {
              return serializeArray(pArg);
          } else if (pArg instanceof Map) {
              return serializeMap((Map) pArg);
          } else if (pArg instanceof Collection) {
              return serializeCollection((Collection) pArg);
          } else {
              return pArg instanceof Number || pArg instanceof Boolean ? pArg : pArg.toString();
          }
      }
docs: Serialize an object to an string or JSON structure for write/exec POST requests.
  Serialization is up to now rather limited:
  <ul>
  <li>
  If the argument is <code>null</code> null is returned.
  </li>
  <li>
  If the argument is of type {@see org.json.simple.JSONAware}, the it is used directly for inclusion
  in the POST request.
  </li>
  <li>
  If the argument is an array, this array's content is put into
  an {@see org.json.simple.JSONArray}, where each array member is serialized recursively.
  </li>
  <li>
  If the argument is a map, it is transformed into a {@see org.json.simple.JSONObject} with the keys taken
  directly from the map and the values recursively serialized to their JSON representation.
  So it is only save fto use or a simple map with string keys.
  </li>
  <li>
  If the argument is a {@link Collection}, it is transformed into a {@see JSONArray} with
  the values recursively serialized to their JSON representation.
  </li>
  <li>
  Otherwise the object is used directly.
  </li>
  </ul>
  
  Future version of this lib will probably provide a more sophisticated serialization mechanism.
  <em>This is how it is supposed to be for the next release, currently a simplified serialization is in place</em>
  
  @param pArg the object to serialize
  @return a JSON serialized object