ElementData extends NodeMap { public void setPayload(JsonValue payload) { put(NodeProperties.PAYLOAD, payload); } ElementData(StateNode node); void setTag(String tag); String getTag(); void setPayload(JsonValue payload); void setVisible(boolean visible); boolean isVisible(); JsonValue getPayload(); @Override boolean allowsChanges();  }
@Test public void collectChanges_setPayloadOnly_onlyOneChanges() { JsonObject object = Json.createObject(); elementData.setPayload(object); List<NodeChange> changes = new ArrayList<>(); elementData.collectChanges(changes::add); Assert.assertEquals(1, changes.size()); Assert.assertTrue(changes.get(0) instanceof MapPutChange); MapPutChange change = (MapPutChange) changes.get(0); Assert.assertEquals(NodeProperties.PAYLOAD, change.getKey()); Assert.assertEquals(elementData.getNode(), change.getNode()); Assert.assertEquals(object, change.getValue()); }