Fix all the tests on beta for Java 8


* compare using JSON library for more robust testing