JsonSerializer { public static String toSafeJson(Object src) { return safeSerializer.toJson(src); }  static String toSafeJson(Object src); static String toPrettyJson(Object src);  }
@Test(dataProvider = "safeTestData") public void testToJson(String jsScript, String expectedJson) throws ScriptException { Object jsObject = executeJavaScript(jsScript).get("input"); String actualJson = JsonSerializer.toSafeJson(jsObject); Assert.assertEquals(actualJson, expectedJson); }