How can I serve or throw IllegalArgumentException, when I should do it?