title: Gson: Directly convert String to JsonObject (no POJO)
body: <p>Can't seem to figure this out.
  I'm attempting JSON tree manipulation in GSON, but I have a case where I do not know or have a POJO to convert a string into, prior to converting to <code>JsonObject</code>. Is there a way to go directly from a <code>String</code> to <code>JsonObject</code>?</p>
  
  <p>I've tried the following (Scala syntax):</p>
  
  <pre><code>val gson = (new GsonBuilder).create
  
  val a: JsonObject = gson.toJsonTree("""{ "a": "A", "b": true }""").getAsJsonObject
  val b: JsonObject = gson.fromJson("""{ "a": "A", "b": true }""", classOf[JsonObject])
  </code></pre>
  
  <p>but <code>a</code> fails, the JSON is escaped and parsed as a <code>JsonString</code> only, and
  <code>b</code> returns an empty <code>JsonObject</code>.</p>
  
  <p>Any ideas?</p>