concept illegalargumentexception in category software development
appears as: IllegalArgumentException, n IllegalArgumentException

This is an excerpt from Manning's book Seriously Good Software: Code that works, survives, and wins.
I chose to throw IllegalArgumentException when the grid is overloaded, even though IllegalStateException describes the situation equally well. Indeed, the error condition is due to the value of an argument (power) being incompatible with the current state of an object field (residualPower). In these cases, Joshua Bloch recommends throwing IllegalArgumentException (see Effective Java, item 72) and resorting to IllegalStateException only when no other argument value would work.
IllegalArgumentException—The value of an argument violates the precondition.
addWater, when used with a negative argument, say – x, requires the total amount of water in the containers connected to this one to be at least x, or else it will throw IllegalArgumentException (IAE).