@Override
    public void delete(final String username, final long deviceId) {
        val account = getAccountInternal(username);
        if (account.getDevices().removeIf(device -> device.getId() == deviceId)) {
            update(account);
        }
    }
This is {@link MongoDbYubiKeyAccountRegistry}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-yubikey-mongo/src/main/java/org/apereo/cas/adaptors/yubikey/dao/MongoDbYubiKeyAccountRegistry.java