title: Comparing two JSONs
body: <p>What's the best way to compare two JSON strings in Java? I want to be able to print out only the difference in key/values pairs. </p>
  
  <p>I'm using gson library to convert it to a map and do assert but it displays both JSONs:</p>
  
  <pre><code>Type type = new TypeToken&lt;Map&lt;String, String&gt;&gt;() {}.getType();
  Gson gson = new Gson();
  Map&lt;String, String&gt; mapExpected = gson.fromJson(expectedJson, type);
  Map&lt;String, String&gt; mapResponse = gson.fromJson(jsonResponse, type);
  Assert.assertEquals(mapExpected, mapResponse);
  </code></pre>
  
  <p>Is there a better way to do this?</p>