Fix missing check for allowEmpty
Add test case
Make allowEmpty reverse of required
Update factory to ensure correct order
Merge branch 'hotfix/4564'

Close #4564
Merge pull request #4567 from davidwindell/patch-11

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

Forward port #4567