class DefaultTwoFactorValidator implements TwoFactorValidator {

    @Getter
    private String provider;

    private Function<String, Boolean> validator;

    private Supplier<TwoFactorToken> tokenSupplier;

    @Override
    public boolean verify(String code, long timeout) {<FILL_FUNCTION_BODY>}

    @Override
    public boolean expired() {
        return tokenSupplier.get().expired();
    }
}

        boolean success = validator.apply(code);
        if (success) {
            tokenSupplier.get().generate(timeout);
        }
        return success;
    
<no_super_class>