No pacote org.springframework.security.core.token há uma interface que possui os seguintes métodos
Token allocateToken(String extendedInformation) Forces the allocation of a new Token.
Token verifyToken(String key) Permits verification the <Token.getKey() was issued by this TokenService and reconstructs the corresponding Token.
Daria para utilizar esta interface neste exemplo?