, , , , . , , . , , , , .
If you have a small package and a class that is used only in a limited context or even in a closed inner class, it will be more relaxed with respect to validation.
I would use an IllegalArgumentException or something derived from it for checking, because this type simplifies what happened and that the error is related to the caller.
source
share