JsonValue { public JsonObject requireObject() { return requireObject(identity()); } 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 public void requireObjectFailure() { exc.expect(SchemaException.class); exc.expectMessage("#: expected type: JsonObject, found: String"); STR.requireObject(); }
@Test public void requireObjectSuccess() { JsonObject actual = OBJ.requireObject(); assertSame(OBJ, actual); }
@Test public void requireObjectWithMapping() { String actual = OBJ.requireObject(obj -> "hello"); assertEquals("hello", actual); }