ProjectedJsonObject extends JsonObject { @Override void require(String key, Consumer<JsonValue> consumer) { throwExceptionIfNotVisible(key); original.require(key, consumer); } ProjectedJsonObject(JsonObject original, Set<String> hiddenKeys); @Override Set<String> keySet(); @Override Object get(String name);  }
@Test(expected = SchemaException.class) public void requireWithConsumerHidesKeys() { Consumer<JsonValue> consumer = mock(Consumer.class); createSubject().require("minimum", consumer); }
@Test(expected = SchemaException.class) public void requireHidesKeys() { createSubject().require("minimum"); }