public Difference<Node> exportChanges(Predicate<Difference<Node>> onlyIf) {
        this.lock.lock();
        try {
            Difference<Node> existing = this.changes;
            if (onlyIf.test(existing)) {
                this.changes = new Difference<>();
                return existing;
            }
            return null;
        } finally {
            this.lock.unlock();
        }
    }
A forwarding {@link NodeMap} that records all mutations and keeps them in a log.
common/src/main/java/me/lucko/luckperms/common/model/nodemap/RecordedNodeMap.java