NodeMap extends NodeFeature { protected void put(String key, Serializable value) { put(key, value, true); } 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 testPutAttachDetachChildren() { StateNode child = StateNodeTest.createEmptyNode("child"); Assert.assertNull(child.getParent()); nodeMap.put(KEY, child); Assert.assertSame(nodeMap.getNode(), child.getParent()); nodeMap.put(KEY, "foo"); Assert.assertNull(child.getParent()); }