WritableNodeOperation implements WriteCursorStrategy { @Override public final void merge(final PathArgument arg, final NormalizedNode<?, ?> data) { WriteableModificationNode potentialChild = node.getChild(arg); if (potentialChild == null) { cursor.merge(arg, data); } else { potentialChild.createOperation(cursor).mergeToCurrent((NormalizedNodeContainer<?, ?, ?>) data); } } protected  WritableNodeOperation(final WriteableModificationNode node, final DOMDataTreeWriteCursor cursor); @Override final void delete(final PathArgument arg); @Override final void merge(final PathArgument arg, final NormalizedNode<?, ?> data); @Override final void write(final PathArgument arg, final NormalizedNode<?, ?> data); @Override final WriteCursorStrategy enter(final PathArgument arg); @Override final void mergeToCurrent(final NormalizedNodeContainer<?, ?, ?> data); @Override @SuppressWarnings("rawtypes") final void writeToCurrent(final NormalizedNodeContainer<?, ?, ?> data);  }
@Test public void mergeTest() throws Exception { returnNull(); this.merge(TestUtils.PATH_ARGUMENT, TestUtils.NORMALIZED_NODE_CONTAINER); verify(TestUtils.DOM_DATA_TREE_WRITE_CURSOR) .merge(TestUtils.PATH_ARGUMENT, TestUtils.NORMALIZED_NODE_CONTAINER); returnNoNull(TestUtils.NORMALIZED_NODE_CONTAINER); this.merge(TestUtils.PATH_ARGUMENT, TestUtils.NORMALIZED_NODE_CONTAINER); verify(TestUtils.WRITE_CURSOR_STRATEGY).mergeToCurrent(TestUtils.NORMALIZED_NODE_CONTAINER); }