@Override
    public Difference<Node> clear(ContextSet contextSet) {
        ImmutableContextSet context = contextSet.immutableCopy();
        Difference<Node> result = new Difference<>();

        this.lock.lock();
        try {
            SortedSet<Node> removed = this.map.remove(context);
            if (removed != null) {
                result.recordChanges(ChangeType.REMOVE, removed);
                this.inheritanceMap.remove(context);
            }
        } finally {
            this.lock.unlock();
        }

        return result;
    }
This lock is used whilst performing mutations, but *not* reads.

The maps themselves are thread safe, so for querying, we just allow
the read methods to do whatever they want without any locking.
However, we want mutations to be atomic, so we use the lock to ensure that happens.
common/src/main/java/me/lucko/luckperms/common/model/nodemap/NodeMapMutable.java