// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java
// static abstract class NodeSkeleton extends AbstractNode {
//     @Override
//     public Node element(int index) {
//         return MISSING_NODE;
//     }
// 
//     @Override
//     public Iterator<KeyValue> fields() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public Node get(String key) {
//         return MISSING_NODE;
//     }
// 
//     @Override
//     public boolean isMissingNode() {
//         return false;
//     }
// 
//     @Override
//     public boolean isNull() {
//         return false;
//     }
// 
//     @Override
//     public Iterator<Node> arrayElements() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public int size() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public String asText() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public BigDecimal decimalValue() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public Boolean asBoolean() {
//         throw new UnsupportedOperationException();
//     }
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
//     if (resourceReader != null) {
//         try {
//             resourceReader.close();
//         } catch (IOException ignored) {
//         }
//     }
// }


import net.javacrumbs.jsonunit.core.internal.GenericNodeBuilder.NodeSkeleton;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.Reader;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
        }
    }

    private static Node newNode(Object object) {
        if (object instanceof JSONObject) {
            return new JSONObjectNode((JSONObject) object);
        } else if (object instanceof Number) {
            return new GenericNodeBuilder.NumberNode((Number) object);
        } else if (object instanceof String) {
            return new GenericNodeBuilder.StringNode((String) object);
        } else if (object instanceof Boolean) {
            return new GenericNodeBuilder.BooleanNode((Boolean) object);
        } else if (object instanceof JSONArray) {
            return new JSONArrayNode((JSONArray) object);
        } else if (JSONObject.NULL.equals(object)) {
            return new GenericNodeBuilder.NullNode();
        } else if (object instanceof Map) {
            return new JSONObjectNode(new JSONObject((Map<?, ?>) object));
        } else if (object instanceof Collection || object.getClass().isArray()) {
            return new JSONArrayNode((JSONArray) JSONObject.wrap(object));
        } else {
            throw new IllegalArgumentException("Unsupported type " + object.getClass());
        }
    }

    @Override
    public boolean isPreferredFor(Object source) {
        return source instanceof JSONObject || source instanceof JSONArray;
    }

// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java
// static abstract class NodeSkeleton extends AbstractNode {
//     @Override
//     public Node element(int index) {
//         return MISSING_NODE;
//     }
// 
//     @Override
//     public Iterator<KeyValue> fields() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public Node get(String key) {
//         return MISSING_NODE;
//     }
// 
//     @Override
//     public boolean isMissingNode() {
//         return false;
//     }
// 
//     @Override
//     public boolean isNull() {
//         return false;
//     }
// 
//     @Override
//     public Iterator<Node> arrayElements() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public int size() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public String asText() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public BigDecimal decimalValue() {
//         throw new UnsupportedOperationException();
//     }
// 
//     @Override
//     public Boolean asBoolean() {
//         throw new UnsupportedOperationException();
//     }
// }
// 
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
//     if (resourceReader != null) {
//         try {
//             resourceReader.close();
//         } catch (IOException ignored) {
//         }
//     }
// }


// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonOrgNodeFactory.java
import net.javacrumbs.jsonunit.core.internal.GenericNodeBuilder.NodeSkeleton;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.Reader;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;

        }
    }

    private static Node newNode(Object object) {
        if (object instanceof JSONObject) {
            return new JSONObjectNode((JSONObject) object);
        } else if (object instanceof Number) {
            return new GenericNodeBuilder.NumberNode((Number) object);
        } else if (object instanceof String) {
            return new GenericNodeBuilder.StringNode((String) object);
        } else if (object instanceof Boolean) {
            return new GenericNodeBuilder.BooleanNode((Boolean) object);
        } else if (object instanceof JSONArray) {
            return new JSONArrayNode((JSONArray) object);
        } else if (JSONObject.NULL.equals(object)) {
            return new GenericNodeBuilder.NullNode();
        } else if (object instanceof Map) {
            return new JSONObjectNode(new JSONObject((Map<?, ?>) object));
        } else if (object instanceof Collection || object.getClass().isArray()) {
            return new JSONArrayNode((JSONArray) JSONObject.wrap(object));
        } else {
            throw new IllegalArgumentException("Unsupported type " + object.getClass());
        }
    }

    @Override
    public boolean isPreferredFor(Object source) {
        return source instanceof JSONObject || source instanceof JSONArray;
    }

    private static final class JSONArrayNode extends NodeSkeleton {