Fix missing check for allowEmpty
Add test case
Make allowEmpty reverse of required
Update factory to ensure correct order
Merge pull request #4567 from davidwindell/patch-11

[InputFilter][Hotfix] Missing check for allowEmpty()
Merge branch 'hotfix/4567'

Close #4567