I need to print the difference between two json array i am using
Type mapType = new TypeToken<Map<String, Object>>() {
}.getType();
Map<String, Object> firstMap = g.fromJson(jsonElement1, mapType);
Map<String, Object> secondMap = g.fromJson(jsonElement2, mapType);
MapDifference diff = Maps.difference(firstMap, secondMap);
The above code was working fine if it a json string object, but it is throwing error
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 now.
How to print the difference between these two json array