+ }
+
+ /**
+ * Read a particular child. If the child has been modified and does not have a stable
+ * view, one will we instantiated with specified version.
+ *
+ * @param child
+ * @param version
+ * @return
+ */
+ Optional<NormalizedNode<?, ?>> read(final PathArgument child, final Version version) {
+ final Optional<ModifiedNode> maybeChild = modification.getChild(child);
+ if (maybeChild.isPresent()) {
+ final ModifiedNode childNode = maybeChild.get();
+
+ Optional<TreeNode> snapshot = childNode.getSnapshot();
+ if (snapshot == null) {
+ // Snapshot is not present, force instantiation
+ snapshot = applyOperation.getChild(child).get().apply(childNode, childNode.getOriginal(), version);
+ }
+
+ return snapshot.transform(READ_DATA);
+ }
+
+ Optional<TreeNode> snapshot = modification.getSnapshot();
+ if (snapshot == null) {
+ snapshot = apply(modification.getOriginal(), version);
+ }
+
+ if (snapshot.isPresent()) {
+ return snapshot.get().getChild(child).transform(READ_DATA);
+ }
+
+ return Optional.absent();