NodeMap extends NodeFeature { protected void clear() { for (String key : new ArrayList<>(keySet())) { remove(key); } } NodeMap(StateNode node); @Override void collectChanges(Consumer<NodeChange> collector); @Override void generateChangesFromEmpty(); @Override void forEachChild(Consumer<StateNode> action); void updateFromClient(String key, Serializable value);  }
@Test public void testClear() { nodeMap.put("foo", 1); nodeMap.put("bar", 1); nodeMap.put("baz", 1); nodeMap.clear(); Assert.assertEquals(0, nodeMap.getPropertyNames().count()); Assert.assertFalse(nodeMap.hasProperty("foo")); Assert.assertFalse(nodeMap.hasProperty("bar")); Assert.assertFalse(nodeMap.hasProperty("baz")); }