No string compare does not work, as the order of elements may not be the same so the strings may not be the same. The utility will report both JSON's as equal even if order of elements is different.
Yes this also works. We were using this for a while until we landed up with very large JSON's. .toMap() is very expensive and takes significantly longer to execute on large JSON's.
5 comments
[ 1.8 ms ] story [ 26.3 ms ] threadBtw, downloaded java-commons as Maven dependency from JitPack: https://jitpack.io/#blobcity/java-commons