public static void restore(NodeState source, NodeStore store)
throws CommitFailedException {
long s = System.currentTimeMillis();
NodeState after = store.getRoot();
NodeBuilder builder = after.builder();
source.compareAgainstBaseState(after, new ApplyDiff(builder));
store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
log.debug("Restore finished in {} ms.", System.currentTimeMillis() - s);
}