Add tests for validator's 'onlyNotNull' switch.