Inpired by CodeContracts, small piece of code that allows you to lower the ciclomatic complexity of code by removing some branching.
Branching like most precondition, if - else - throw or if - else - set value.
Simple implementation of the OWASP recommended password policy including the top common patterns checking.
See the https://www.owasp.org/index.php/Authentication_Cheat_Sheet#Password_Complexity for more info.