JsonUtils { public static Node convertToJson(Object source, String label) { return convertToJson(source, label, false); }  static Node convertToJson(Object source, String label); static Node convertToJson(Object source, String label, boolean lenient); static Node valueToNode(Object source); static Node getNode(Object root, String path); static Node getNode(Object root, Path path); @Deprecated static boolean nodeExists(Object json, String path); static boolean nodeAbsent(Object json, String path, Configuration configuration); static boolean nodeAbsent(Object json, Path path, Configuration configuration); static Object jsonSource(final Object json, final String pathPrefix); static String getPathPrefix(Object json); static Node wrapDeserializedObject(Object source); static Object missingNode();  }
@Test void testConvertToJson() { assertEquals(STRING, convertToJson("\"a\"", "x").getNodeType()); assertEquals(NUMBER, convertToJson(1, "x").getNodeType()); assertEquals(NUMBER, convertToJson("1", "x").getNodeType()); assertEquals(NUMBER, convertToJson(1.0, "x").getNodeType()); assertEquals(NUMBER, convertToJson("1.0", "x").getNodeType()); assertEquals(OBJECT, convertToJson("{\"a\":1}", "x").getNodeType()); assertEquals(ARRAY, convertToJson("[1 ,2, 3]", "x").getNodeType()); assertEquals(BOOLEAN, convertToJson("true", "x").getNodeType()); assertEquals(BOOLEAN, convertToJson(true, "x").getNodeType()); assertEquals(BOOLEAN, convertToJson("false", "x").getNodeType()); assertEquals(BOOLEAN, convertToJson(false, "x").getNodeType()); assertTrue(convertToJson("null", "x").isNull()); assertTrue(convertToJson(null, "x").isNull()); }