title: Convert String to JsonObject in kotlin returns null
body: <p><strong>Edit Found Solution:</strong></p>
  <p><strong>Found the error in my code. I'm running this on a unit test and Android doesn't use JSON objects on unit tests because it's part of android. That's why it was returning null.</strong></p>
  <p>Question:</p>
  <p>I'm tying to convert my String back to a JsonObject using JSONObject(&quot;string&quot;)</p>
  <p>Here is a sample of my String:</p>
  <pre><code>{
    &quot;sessions&quot;: [
      {
        &quot;locations&quot;: [
          {
            &quot;lat&quot;: &quot;14.2294625&quot;,
            &quot;lng&quot;: &quot;121.1509005&quot;,
            &quot;time&quot;: 1560262643000,
            &quot;speed&quot;: 0,
            &quot;speedLimit&quot;: 0
          },
          {
            &quot;lat&quot;: &quot;14.2294576&quot;,
            &quot;lng&quot;: &quot;121.1509498&quot;,
            &quot;time&quot;: 1560262713000,
            &quot;speed&quot;: 0,
            &quot;speedLimit&quot;: 0
          },
          {
            &quot;lat&quot;: &quot;14.2294576&quot;,
            &quot;lng&quot;: &quot;121.1509498&quot;,
            &quot;time&quot;: 1560262714000,
            &quot;speed&quot;: 0,
            &quot;speedLimit&quot;: 0
          }
        ],
        &quot;name&quot;: &quot;1.5645220491E12&quot;
      }
    ]
  }
  </code></pre>
  <p>Its returning null on my JsonObjects:</p>
  <pre><code>content = &quot;the string above&quot;
  
  var obj = JSONObject(content.substring(content.indexOf(&quot;{&quot;), content.lastIndexOf(&quot;}&quot;) + 1))
  System.out.println(&quot;obj1: &quot; + obj.toString())
  
  obj = JSONObject(content)
  System.out.println(&quot;obj1: &quot; + obj.toString())
  
  var obj1 = JSONArray(content)
  System.out.println(&quot;obj1: &quot; + obj1.toString())
  
  obj1 = JSONArray(content.substring(content.indexOf(&quot;{&quot;), content.lastIndexOf(&quot;}&quot;) + 1))
  System.out.println(&quot;obj2: &quot; + obj1.toString())
  </code></pre>
  <p>All the outputs of this are null. Any way to know what error happens so I can adjust my json string?</p>