public void replay(RemoveAccessControlEntryRecord record) {
        if (image.acls().containsKey(record.id())) {
            changes.put(record.id(), Optional.empty());
        } else if (changes.containsKey(record.id())) {
            changes.remove(record.id());
            // No need to track a ACL that was added and deleted within the same delta
        } else {
            throw new IllegalStateException("Failed to find existing ACL with ID " + record.id() + " in either image or changes");
        }
    }
This method replays a RemoveAccessControlEntryRecord record. If the current image contains the ACL
the removal is stored as an Optional.empty() value in the Map. If the changes Map contains the ACL
it means the ACL was recently applied and isn't in the image yet, in which case the ACL can be totally removed
from the Map because there is no need to add it then delete it when the changes are applied.

@param record Log metadata record to replay.
metadata/src/main/java/org/apache/kafka/image/AclsDelta.java