+ private static int findChildrenBefore(final Optional<TreeNode> current) {
+ if (current.isPresent()) {
+ return numOfChildrenFromValue(current.get().getData());
+ } else {
+ return 0;
+ }
+ }
+
+ private static int findChildrenAfter(final ModifiedNode modification) {
+ if (modification.getWrittenValue() != null) {
+ return numOfChildrenFromValue(modification.getWrittenValue());
+ } else {
+ return 0;
+ }
+ }
+