By the way, it's generally not a good idea to use assertions for checking the preconditions of
public methods or constructors.
You should throw an IllegalArgumentException (run-time exception) instead, so that the public contract is enforced whether assertions are turned on or not.
Use assertions for checking the preconditions of
non-public methods, or for checking internal consistency and post-conditions.