@Override
    public void remove(final String uid, final Integer otp) {
        lock.tryLock(__ -> {
            val dataset = this.storage.asMap();
            LOGGER.debug("Locating user [{}] to remove token [{}]", uid, otp);
            if (dataset.containsKey(uid)) {
                val tokens = dataset.get(uid);
                tokens.removeIf(t -> otp.equals(t.getToken()));
                LOGGER.debug("Final collection of tokens for [{}] after removal are [{}]", uid, tokens);
                this.storage.put(uid, tokens);
            }
        });
    }
This is {@link CachingOneTimeTokenRepository}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-otp-mfa-core/src/main/java/org/apereo/cas/otp/repository/token/CachingOneTimeTokenRepository.java