Turned example into test with some validation code.