//set the value of a child
rootNode.setValueOfChildAsBoolean(SAMPLE_NAME_1, true);
//verify it was set properly
SettingsNode childNode1 = rootNode.getChildNode(SAMPLE_NAME_1);
assertNotNull(childNode1);
assertEquals("true", childNode1.getValue());
//make sure there's only 1 child.
children = rootNode.getChildNodes();
assertEquals(1, children.size());
//set the value again. This should set the value and NOT add an additional node
rootNode.setValueOfChildAsBoolean(SAMPLE_NAME_1, false);
childNode1 = rootNode.getChildNode(SAMPLE_NAME_1);
assertNotNull(childNode1);
assertEquals("false", childNode1.getValue());
//make sure there's still only 1 child.
children = rootNode.getChildNodes();
assertEquals(1, children.size());
//set the value again to the same value. Again, this should set the value and NOT add an additional node
rootNode.setValueOfChildAsBoolean(SAMPLE_NAME_1, false);
childNode1 = rootNode.getChildNode(SAMPLE_NAME_1);
assertNotNull(childNode1);
assertEquals("false", childNode1.getValue());
//make sure there's still only 1 child.
children = rootNode.getChildNodes();
assertEquals(1, children.size());
}