// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
//     return convertToJson(source, label, false);
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node getNode(Object root, String path) {
//     return getNode(root, Path.create(path));
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static boolean nodeAbsent(Object json, String path, Configuration configuration) {
//     return nodeAbsent(json, Path.create(path), configuration);
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// @Deprecated
// public static boolean nodeExists(Object json, String path) {
//     return !getNode(json, path).isMissingNode();
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// static String quoteIfNeeded(String source) {
//     String trimmed = source.trim();
// 
//     if (isObject(trimmed) || isArray(trimmed) || isString(trimmed)
//         || isBoolean(trimmed) || isNull(trimmed)
//         || isNumber(trimmed)) {
//         return source;
//     } else {
//         return "\"" + source + "\"";
//     }
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node valueToNode(Object source) {
//     if (source instanceof Node) {
//         return (Node) source;
//     } else {
//         return converter.valueToNode(source);
//     }
// }


import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.getNode;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.nodeAbsent;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.nodeExists;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.quoteIfNeeded;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.valueToNode;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.ARRAY;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.BOOLEAN;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.NULL;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.NUMBER;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.OBJECT;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.STRING;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
    }

    @Test
    void testGetStartNodeArraysRoot() throws IOException {
        Node startNode = getNode(mapper.readTree("[1,2]"), "[0]");
        assertEquals(1, startNode.decimalValue().intValue());
    }

    @Test
    void testGetStartNodeNonexisting() throws IOException {
        Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), "test.bogus");
        assertEquals(true, startNode.isMissingNode());
    }

    @Test
    @SuppressWarnings("deprecation")
    void testNodeExists() {
        String json = "{\"test\":{\"value\":1}}";
        assertTrue(nodeExists(json, "test"));
        assertTrue(nodeExists(json, "test.value"));
        assertFalse(nodeExists(json, "test.nonsense"));
        assertFalse(nodeExists(json, "root"));
    }

    @Test
    void testNodeAbsent() {
        String json = "{\"test\":{\"value\":1, \"value2\": null}}";
        assertFalse(nodeAbsent(json, Path.create("test"), false));
        assertFalse(nodeAbsent(json, Path.create("test.value"), false));
        assertTrue(nodeAbsent(json, Path.create("test.nonsense"), false));
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
//     return convertToJson(source, label, false);
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node getNode(Object root, String path) {
//     return getNode(root, Path.create(path));
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static boolean nodeAbsent(Object json, String path, Configuration configuration) {
//     return nodeAbsent(json, Path.create(path), configuration);
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// @Deprecated
// public static boolean nodeExists(Object json, String path) {
//     return !getNode(json, path).isMissingNode();
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// static String quoteIfNeeded(String source) {
//     String trimmed = source.trim();
// 
//     if (isObject(trimmed) || isArray(trimmed) || isString(trimmed)
//         || isBoolean(trimmed) || isNull(trimmed)
//         || isNumber(trimmed)) {
//         return source;
//     } else {
//         return "\"" + source + "\"";
//     }
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node valueToNode(Object source) {
//     if (source instanceof Node) {
//         return (Node) source;
//     } else {
//         return converter.valueToNode(source);
//     }
// }


// Path: json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.getNode;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.nodeAbsent;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.nodeExists;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.quoteIfNeeded;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.valueToNode;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.ARRAY;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.BOOLEAN;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.NULL;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.NUMBER;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.OBJECT;
import static net.javacrumbs.jsonunit.core.internal.Node.NodeType.STRING;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

    }

    @Test
    void testGetStartNodeArraysRoot() throws IOException {
        Node startNode = getNode(mapper.readTree("[1,2]"), "[0]");
        assertEquals(1, startNode.decimalValue().intValue());
    }

    @Test
    void testGetStartNodeNonexisting() throws IOException {
        Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), "test.bogus");
        assertEquals(true, startNode.isMissingNode());
    }

    @Test
    @SuppressWarnings("deprecation")
    void testNodeExists() {
        String json = "{\"test\":{\"value\":1}}";
        assertTrue(nodeExists(json, "test"));
        assertTrue(nodeExists(json, "test.value"));
        assertFalse(nodeExists(json, "test.nonsense"));
        assertFalse(nodeExists(json, "root"));
    }

    @Test
    void testNodeAbsent() {
        String json = "{\"test\":{\"value\":1, \"value2\": null}}";
        assertFalse(nodeAbsent(json, Path.create("test"), false));
        assertFalse(nodeAbsent(json, Path.create("test.value"), false));
        assertTrue(nodeAbsent(json, Path.create("test.nonsense"), false));
        assertTrue(nodeAbsent(json, Path.create("root"), false));