@Override
    public void removeAttachment(@NonNull PermissionAttachment attachment) {
        Objects.requireNonNull(attachment, "attachment");

        LuckPermsPermissionAttachment luckPermsAttachment;

        if (!(attachment instanceof LuckPermsPermissionAttachment)) {
            // try to find a match
            LuckPermsPermissionAttachment match = this.hookedAttachments.stream().filter(at -> at.getSource() == attachment).findFirst().orElse(null);
            if (match != null) {
                luckPermsAttachment = match;
            } else {
                throw new IllegalArgumentException("Given attachment is not a LPPermissionAttachment.");
            }
        } else {
            luckPermsAttachment = (LuckPermsPermissionAttachment) attachment;
        }

        if (luckPermsAttachment.getPermissible() != this) {
            throw new IllegalArgumentException("Attachment does not belong to this permissible.");
        }

        luckPermsAttachment.remove();
    }
Adds attachments to this permissible.

@param attachments the attachments to add
bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/LuckPermsPermissible.java