ProjectedJsonObject extends JsonObject { @Override public Set<String> keySet() { Set<String> keys = new HashSet<>(original.keySet()); keys.removeAll(hiddenKeys); return keys; } ProjectedJsonObject(JsonObject original, Set<String> hiddenKeys); @Override Set<String> keySet(); @Override Object get(String name);  }
@Test public void keySetExcludesHiddenKeys() { assertEquals(singleton("not"), createSubject().keySet()); }