}
NodeKey childKey = ref.getKey();
// Are nodes inserted before this node?
Insertions insertions = insertionsByBeforeKey.remove(childKey);
if (insertions != null) {
for (ChildReference inserted : insertions.inserted()) {
newChildren.add(inserted);
}
}
if (removals.remove(childKey)) {
// The node is removed ...