JsonValue { public <T> VoidMultiplexer canBe(Class<T> expectedType, Consumer<T> consumer) { return new VoidMultiplexer(expectedType, consumer); } 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 multiplexerFailure() { exc.expect(SchemaException.class); exc.expectMessage("#: expected type is one of Boolean or String, found: Integer"); INT.canBe(String.class, str -> { }) .or(Boolean.class, bool -> { }) .requireAny(); }