title: How to compare two JSON Strings for equality using GSON?
body: <p>I am trying to compare two JSON Strings for equality. I found this <a href="https://stackoverflow.com/a/3217065/663148">solution</a> which uses Jackson as shown below but in all my project I am using GSON so I need to do the same thing using GSON.</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  JsonNode tree1 = mapper.readTree(jsonString1);
  JsonNode tree2 = mapper.readTree(jsonString2);
  if (tree1.equals(tree2)) { 
    // yes, contents are equal -- note, ordering of arrays matters, objects not
  } else { 
    // not equal
  }
  </code></pre>
  
  <p>Is there any way to compare two JSON String for equality using GSON?</p>