@Override
    public MultifactorAuthenticationTrustRecord get(final long id) {
        remove();
        val result = storage.asMap()
            .values()
            .stream()
            .filter(entry -> entry.getId() == id)
            .sorted()
            .findFirst();

        if (result.isPresent()) {
            val record = result.get();
            LOGGER.trace("Found multifactor authentication trust record [{}]", record);
            return record;
        }
        return null;
    }
This is {@link InMemoryMultifactorAuthenticationTrustStorage}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-trusted-mfa-core/src/main/java/org/apereo/cas/trusted/authentication/storage/InMemoryMultifactorAuthenticationTrustStorage.java