This example was made for https://stackoverflow.com/questions/60626886/how-to-check-for-old-passwords-using-spring-matches-method/
Only use this code if you know what you are doing, as the concept of the SO question contained many flaws and was underspecified.