throw illegal argument exception when the specified size is negative