+ @Test
+ public void addGrandChildPolytomousKeyNode() {
+
+ PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ PolytomousKeyNode rootChildNode = pKey.getRoot().getChildAt(0);
+ PolytomousKeyNode grandChildNode = PolytomousKeyNode.NewInstance();
+ rootChildNode.addChild(grandChildNode);
+
+ pKey = polytomousKeyService.merge(pKey, true);
+ grandChildNode = pKey.getRoot().getChildAt(0).getChildAt(0);
+ Assert.assertTrue(0 != grandChildNode.getId());
+
+ grandChildNode.setStatement(KeyStatement.NewInstance("test"));
+ pKey = polytomousKeyService.merge(pKey, true);
+
+ grandChildNode = pKey.getRoot().getChildAt(0).getChildAt(0);
+ KeyStatement ks = grandChildNode.getStatement();
+ Assert.assertTrue(0 != ks.getId());
+
+ }
+