JsonValue { static JsonValue of(Object obj) { if (obj instanceof JsonValue) { return (JsonValue) obj; } else if (obj instanceof Map) { return new JsonObject((Map<String, Object>) obj); } else if (obj instanceof List) { return new JsonArray((List<Object>) obj); } else if (obj instanceof JSONObject) { return new JsonObject(toMap((JSONObject) obj)); } else if (obj instanceof JSONArray) { return new JsonArray(toList((JSONArray) obj)); } return new JsonValue(obj); } protected  JsonValue(Object obj); VoidMultiplexer canBe(Class<T> expectedType, Consumer<T> consumer); VoidMultiplexer canBeSchema(Consumer<JsonValue> consumer); Multiplexer<R> canBeMappedTo(Class<T> expectedType, Function<T, R> mapper); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String requireString(); R requireString(Function<String, R> mapper); Boolean requireBoolean(); R requireBoolean(Function<Boolean, R> mapper); JsonObject requireObject(); R requireObject(Function<JsonObject, R> mapper); JsonArray requireArray(); R requireArray(Function<JsonArray, R> mapper); Number requireNumber(); R requireNumber(Function<Number, R> mapper); Integer requireInteger(); R requireInteger(Function<Integer, R> mapper);  }
@Test @Parameters(method = "providerTestFactory") public void testFactory(Object raw, Class<?> expectedRetType) { assertThat(JsonValue.of(raw), is(instanceOf(expectedRetType))); }