@Test
public void testWriteRootNodeWithInvalidChild() throws Exception {

    final Shard mockShard = Mockito.mock(Shard.class);
    ShardDataTree shardDataTree = new ShardDataTree(mockShard, SCHEMA_CONTEXT, TreeType.CONFIGURATION);
    NormalizedNode<?, ?> root = shardDataTree.readNode(YangInstanceIdentifier.empty()).get();
    NormalizedNode<?, ?> normalizedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(root.getNodeType())).withChild(
                    ImmutableNodes.containerNode(AUG_CONTAINER)).build();
    pruningDataTreeModification.write(YangInstanceIdentifier.empty(), normalizedNode);
    dataTree.commit(getCandidate());
    Optional<NormalizedNode<?, ?>> actual = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty());
    assertEquals("Root present", true, actual.isPresent());
    assertEquals("Root node", root, actual.get());
}