ProjectedJsonObject extends JsonObject { @Override <R> R requireMapping(String key, Function<JsonValue, R> fn) { throwExceptionIfNotVisible(key); return original.requireMapping(key, fn); } ProjectedJsonObject(JsonObject original, Set<String> hiddenKeys); @Override Set<String> keySet(); @Override Object get(String name);  }
@Test public void requireMappingSucceeds() { Boolean actual = createSubject().requireMapping("not", val -> true); assertTrue(actual); }
@Test(expected = SchemaException.class) public void requireMappingFailsForHiddenKey() { createSubject().requireMapping("minimum", val -> true); }